In our backend we are raising events for creating push notifications and message only through FCM (separated).
One "message"(data only) for customer and the clients related to order for updating it on screens etc, and one push notification for customer.
The thing is that, android receives both push and message, but IOS only receives the message, and not the push notification.
When I send push notifications directly to an Iphone device through tests from our .NET backend (which implements the Firebase messaging service, which also uses the same events that are raised), the Iphone device receives the push notification.
We are using app distribution and the app is built with react-native. Our backend .NET, using firebase-admin SDK.
Things we have noticed are:
Uninstall and install the app again makes the notification work but only once then it stops working.
When the customer app is on the same device as the other app that "triggers" the updates on an order if it´s updated, the notification is received to the same device in the customer app.
Code:
Message message = new Message
{
Token = token,
Notification = new Notification
{
Title = title,
Body = body
},
Android = new AndroidConfig
{
Data = data as IReadOnlyDictionary<string, string>,
Priority = Priority.High,
TimeToLive = TimeSpan.FromMinutes(ttl),
Notification = new AndroidNotification
{
ChannelId = "default"
}
},
Apns = new ApnsConfig
{
Aps = new Aps
{
ContentAvailable = true,
CustomData = dataToStringObject
}
}