0
iOSのFirebase通知に奇妙な問題があります。それは完璧に動作しますが、唯一の問題は、サーバー上の 'body'パラメータを空のままにしておくと、アプリケーション上で通知音が鳴りますが、何も表示されないということです。同じことがAndroidでの通知を表示します。アップルのセキュリティのようなものですか?私は空のスペースを "body"に追加するだけですが、それがなければ何も表示されません。もし何か体が私に何か示唆することができる場合はどうぞ。 私のサーバー側のコードがiOSが空です。Firebaseプッシュ通知が表示されません。
$msg = array
(
'title' => '',
'body' => ' ',
'click_action' => '.InstagramLoader',
'icon' => 'myicon',/*Default Icon*/
'sound' => 'mySound'/*Default sound*/
);
$data = array(
'text' => $title,
'img_url' => $img_url
);
$fields = array
(
'to' => $registrationIds,
'notification' => $msg,
'data' => $data
);
$headers = array
(
'Authorization: key=' . API_ACCESS_KEY,
'Content-Type: application/json'
);
#Send Reponse To FireBase Server
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL, 'https://fcm.googleapis.com/fcm/send');
curl_setopt($ch,CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec($ch);
curl_close($ch);
この投稿は、類似の問題について説明しています。https://stackoverflow.com/questions/45214234/ios-remote-notification-not-received-unless-running-from-xcode –