We are using FCM to send remote notifications for both iOS and Android. The following are the payloads we are sending from the backend.
options = {
notification: {
title: "title",
body: body,
sound: 'default'
},
priority: "high",
content_available: true,
data: {
type: 'type',
id: id,
}
}
This works for ios and android.
But for some reason, the android side we need to send title
,body
and sound
for keys in data
payload and need to remove notification
payload.
Now the notifications are not receiving ios side when app is not active, banner notifications are not arriving but the data is receiving when app is active. We need banners on the iOS side.
Is that notification
key is mandatory to display banner
in iOS?
How to use the same payload for both iOS and Android.
options = {
priority: "high",
content_available: true,
data: {
title: "title",
body: body,
sound: 'default'
type: 'type',
id: id,
}
}
Also tried adding content_available
and priority
keys with various combinations.
Gone through all FCM docs and it still confuses. Help/Suggestions appreciated.