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