I am developing a react-native app using fcm and react-native-fcm library. I am sending the notifications like this:
function sendNotification(notificationType, payload, registrationToken) {
var options = {
priority: "high",
ttl: 0,
content_available: true
};
var messageContent = {
data: {
type: notificationType,
payload: JSON.stringify(payload)
}
};
admin.messaging().sendToDevice(registrationToken, messageContent, options)
.then(function (response) {
console.log("Successfully sent message:", response);
})
.catch(function (error) {
console.log("Error sending message:", error);
}); }
In android I receive the notifications correctly (both foreground and background).
In IOS, at first I receive them also both in foreground and background, however, after several times I am sending notifications, I stop receive them in background, and all of the notifications arrive only in when app is in foreground.
I have found this answer, talking about throttling in the IOS level, but I can't find any documentation about that. Does it mean that I can't control the background notifications in IOS for my app? And I can only send X messages for a minute? How do chat apps on IOS handle this issue?