我已尝试使用Laravel的Firebase通知将通知发送到IOS和Android设备。
但是IOS设备未收到通知,但Android设备运行良好。
那么我的脚本出了什么问题?
我试过跟随
$firebase = new \Firebase();
$push = new \Push();
// optional payload
$payload = array();
$payload['team'] = 'India';
$payload['score'] = '5.6';
// notification title
$title = Input::get('title');
// notification message
$message = Input::get('message');
// push type - single user / topic
$push_type = Input::get('push_type');
// whether to include to image or not
$include_image = Input::get('include_image') ? TRUE : FALSE;
$include_image = TRUE;
$push->setTitle($title);
$push->setMessage($message);
if ($include_image) {
$push->setImage('http://api.androidhive.info/images/minion.jpg');
} else {
$push->setImage('');
}
$push->setIsBackground(FALSE);
$push->setPayload($payload);
$json = '';
$response = '';
if ($push_type == 'topic') {
$json = $push->getPush();
$response = $firebase->sendToTopic('global', $json);
} else if ($push_type == 'individual') {
$json = $push->getPush();
$regId = Input::get('regId');
$response = $firebase->send($regId, $json);
}
我已经提出了这个问题,但没有提供答案。
您需要iOS的“ notification” json块来响应
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句