Cannot Receive Notification In Ios [firebase]
Solution 1:
For Firebase push to work on iOS, you must set priority
to high
. Reference:
Can't send push notifications using the server API
Solution 2:
You can use the same json for both android and ios. Firebase Cloud Messaging will use the relevant parameters for each platform
example:
icon
will be removed from messages targeting iOS since that platform doesn't support changing the icon.sound
should be a filename with extension (extension required for ios). Firebase will remove the extension when targeting an android device.
Regarding the messages not being delivered to iOS try to increase the priority
parameter.
https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream-http-messages-json
When the ios app is in background Firebase uses APNs to deliver the message, and APNs often delay messages that don't have high priority.
If that doesn't work please check your APNs certificate configuration.
Solution 3:
In my json I added aps
object
'aps' => array(
'alert' => $messageText,
'badge' => $badge,
'sound' => 'default',
'id' => $id
),
Post a Comment for "Cannot Receive Notification In Ios [firebase]"