作者 jinglong
1 个管道 的构建 通过 耗费 22 秒

修改ios生产环境推送

@@ -2519,12 +2519,14 @@ class CommonController extends RestBaseController @@ -2519,12 +2519,14 @@ class CommonController extends RestBaseController
2519 $app_key = config('site.app_key'); 2519 $app_key = config('site.app_key');
2520 $master_secret = config('site.master_secret'); 2520 $master_secret = config('site.master_secret');
2521 $client = new JPush($app_key, $master_secret); 2521 $client = new JPush($app_key, $master_secret);
  2522 + $ios_notification = ['sound' => 'sound','badge' => '+1'];
2522 $result = $client->push() 2523 $result = $client->push()
2523 ->setPlatform('all') 2524 ->setPlatform('all')
2524 ->addRegistrationId($registration_id) 2525 ->addRegistrationId($registration_id)
2525 ->setMessage($content, $title,'text') 2526 ->setMessage($content, $title,'text')
2526 ->addAndroidNotification($content,$title,1) 2527 ->addAndroidNotification($content,$title,1)
2527 - ->addIosNotification($content, 'iOS sound', '+1', true, 'iOS category') 2528 + ->iosNotification($content, $ios_notification)
  2529 + ->options(['apns_production' => true])//切换到ios生产环境
2528 ->send(); 2530 ->send();
2529 return $result; 2531 return $result;
2530 } 2532 }