react native push notification not display when app in background on ios - ios

I have react native application until now I used react-native-firebase version 5.5.6 (https://www.npmjs.com/package/react-native-firebase/v/5.5.6) to recived push notification and every work fine in android and ios.
now i upgrade to react-native-firebase version 11.1.2 and react-native-firebase/messaging version 11.1.2.
in android the notification work fine in all app state (foreground, background, closed)
in ios when app in foreground the notification recived fine but in in background or closed app the notification not showing
I mark the remote notification and fetch notification in background modes in xcode
when the in foreground and i received notification this is json i received
{
aps = {
alert = {
body = "\nCat. No.: 34612\nAddress: \U05d1\U05e0\U05d9\U05d9\U05df \U05e2\U05d9\U05e8\U05d9\U05d9\U05d4 \U05d1\nFloor: 2\nReported about: Intercoms \nStatus: Your call has been received\n Description: check\n Full name: \U05d2\U05dc\U05d7\U05d1\U05d7 \U05dc\U05d1\U05d9\U05d0\U05d7\U05d2\U05d7";
title = "New message about a service call";
};
badge = 2;
"content-available" = 1;
"mutable-content" = 1;
};
"custom_notification" = "{\"title\":\"New message about a service call\",\"body\":\"\\nCat. No.: 34612\\nAddress: \U05d1\U05e0\U05d9\U05d9\U05df \U05e2\U05d9\U05e8\U05d9\U05d9\U05d4 \U05d1\\nFloor: 2\\nReported about: Intercoms \\nStatus: Your call has been received\\n Description: check\\n Full name: \U05d2\U05dc\U05d7\U05d1\U05d7 \U05dc\U05d1\U05d9\U05d0\U05d7\U05d2\U05d7\",\"show_in_foreground\":true,\"icon\":\"push_notification\",\"sound\":\"default\"}";
deepLink = "https://darimpo-test.appspot.com/#openApplication?serviceCallId=34612&taskPostId=151288";
"fcm_options" = {
image = "https://storage.googleapis.com/download/storage/v1/b/darimpo_test_images/o/8551.jpg?generation=1615666155330439&alt=media";
};
"gcm.message_id" = 1616606515037965;
"google.c.a.e" = 1;
"show_in_foreground" = "{\"title\":\"New message about a service call\",\"body\":\"\\nCat. No.: 34612\\nAddress: \U05d1\U05e0\U05d9\U05d9\U05df \U05e2\U05d9\U05e8\U05d9\U05d9\U05d4 \U05d1\\nFloor: 2\\nReported about: Intercoms \\nStatus: Your call has been received\\n Description: check\\n Full name: \U05d2\U05dc\U05d7\U05d1\U05d7 \U05dc\U05d1\U05d9\U05d0\U05d7\U05d2\U05d7\",\"show_in_foreground\":true,\"icon\":\"push_notification\",\"sound\":\"default\"}";
}
maybe you now why is not working for me
thank you

Related

Xamarin IOS Push Killed app

Push =>
{{
aps = {
alert = {
"loc-args" = (
);
"loc-key" = "new_chat";
};
"content-available" = 1;
id = 3;
message = Aaa;
sound = default;
subject = "new_chat";
type = chat;
};
}}
When the application is killed and I receive a push notification it is shown with the text "new_chat". How can I change it to another text?
Assuming you are targeting iOS 10+, you can add a Notification Services extension app (UNNotificationServiceExtension) to your app bundle.
modifies the content of a remote notification before it is delivered to the user.
In the DidReceiveNotificationRequest override, extract your content from the UNNotificationRequest and modify it and return it via the contentHandler provided.
Required reading to understand how/when the extension is used:
Modifying Content in Newly Delivered Notifications
Also:
Xamarin Docs: iOS Extensions in Xamarin.iOS
Apple docs: UNNotificationServiceExtension

Gcm ios push notifications in background fail

I can receive push notifications when my app is in foreground but it is not working in background.
When I send the json has this form:
{
"data":{"message":"test ios push notification"},
"time_to_live":604800,
"registration_ids":["key...."],
"collapse_key":"GCM Notifications",
"content_available":1,
"priority":"high"
}
In my application I get in foreground (nothing in background):
{
aps = {
"content-available" = 1;
};
"gcm.message_id" = " whatever ";
message = "test ios push notification";
}
I think that the problem is around content_available but I dont know why I send content_available and the return is content-available. Is this a normal conversion?
SOLVED!
Me bad, I forget to enable it in target -> Capabilities section:

Firebase message (FCM) not work in close app

This Post is referenced by FCM.
If the application is active state or in background state then all is well it's working fine.
But if you close(Terminate) the application. The messages do not come, that I would not do it.
Priority is high in messages.
Messages like :
act = msg;
aps = {
"content-available" = 1;
};
"chat_id" = 26;
date = "2016-08-23 08:05:21";
delay = 300;
"from_user" = 25;
"gcm.message_id" = "0:1471939....f965049af";
id = 898;
"is_read" = 0;
msg = sds;
type = 1;
How to make that message come close application?
Just ran many tests. It appears that in order to have the message delivered to a "closed" IOS app, you need to specific priority=high. With priority unspecified or set to "normal" it will not deliver the notification to a closed app. When the app restarts, it seems the undelivered messages will be sent and handled in the same way as if the app were in the foreground when they were sent originally.

Can't Get GCM Notification from background ios sdk

I can't get GCM notification from background, Although can receive it on foreground such as these:
{
aps = {
alert = {
body = fffff;
title = "\U067e\U06cc\U0627\U0645";
};
badge = 9;
sound = default;
};
"gcm.message_id" = "0:1448218309944532%075c2cd9075c2cd9";
}
Any help?
To get notifications in background, as per apple documentation
"Remote notifications" option needs to be enabled in Background modes under Capabilities in the target settings.
and normally when you receive any notification at that time application:didReceiveRemoteNotification: this method called.
and if you want to call this method in background, then you should sent a silent pushnotification. and for that you have to add content-available key with value 1 into the notification payload.
you JSON response contain that key like below example
{
aps = {
"content-available" : 1,
sound : ""
};
}

Push notification badge not updating in iOS 7.1 when app is closed or in background

{
aps = {
alert = "You have assigned 1 new task.";
badge = 1;
sound = "default"
};
}
The same JSON Payload is working in iOS 8+ but not in 7.1
Am I missing something here in payload?
I have checked for the notification settings and it's fine too.

Resources