正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
@@ -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 | } |
-
请 注册 或 登录 后发表评论