GCM 3.0 - send notification paylod to iOS and data payload to Android? - google-cloud-messaging

I would like to use the notification payload for iOS notifications (not Android), and the data payload for Android.
Is this possible? I am worried by using the notification payload for iOS, the Android notification will ben generated automatically.

With a single topic, if you want to deliver a push via notification payload on iOS, but via data payload on Android, you can't!
For example, if you have a topic called "awesome_news" you should split this into two topics: "awesome_news_ios" and "awesome_news_android"

Related

Can I modify expo push notification title/body before showing the notification?

I'm using expo notification service.
I would like to send keys from backend, e.g.
{
title: "TITLE_KEY",
body: "BODY_KEY"
}
then translate it when it comes on the mobile side (based on the key), before showing it, so user would not see the key on notification, just the translated text...
So the question is how could I modify notification before showing it to the user?

selecting react native push notification

I am using react native and trying to add push notification.
My application need push notification because of chatting. I just need push notification to appear whenever the user receives chat message.
I've searched couple of libraries about push notification and found out firebase and react-native-push-notification.
Which one is proper library for this case and please tell me if there is other better way to solve this problem.
We're using invertase firebase notification library which is working so far better without any issues.
You'll get almost all the options which you needed for push notification customization like badges, etc.

how to extract parameter from Branch.io deep link url getting via push notification from Locality's. in React native

I am using Branch.IO to generate deep links. Now the normal flow works perfectly. Opens the application on tapping the link from the mobile browser.
The problem is when I put the deep link URL in the payload of notification and tap on the notification. I will get deep link Url but what is the best way to redirect on particular screen based on url parameter in react native?. i am not getting parameter
i am sending notification via locality's
Thanks in advance.
You can send custom data in the payload of the notification, may be a notification type and use that type to show the desired screen on notification tap.
For how to send Custom data in payload please check:
Apple Push Notification with Sending Custom Data

how to get notification status of our android app dynamically

We implemented a chat application in android ,when user don't want to get any notifications,
he will turn off the notification in settings of the app ,
but how to get the "status of the notification"(on/off) in android programming in order to prevent sending notifications to those users who turned off ,in order to save the charges which will apply to send notifications to users....
after I had searched a lot.... I found solution to get the Notification status of our app here:
Use
NotificationManagerCompat.from(context).areNotificationsEnabled()
Use NotificationManagerCompat.from(Context).areNotificationsEnabled(), from support library, to check if notifications are blocked on API 19+. The versions below API 19 will return true (notifications are enabled).
For more details go through this link :get NotificationStatus based on version

How does FB messenger removes push notification from iOS app when I see the message on FB Desktop?

Whenever I get a notification about a message on my iPhone from Facebook and I reply to that message from Facebook website, that push notification goes away from my iPhone home screen. How is Facebook doing that? I know push notification don't have delivery confirmation mechanism in iOS. Here in this scenario Facebook knows I have read the message so are they pushing something to their app to remove notification? Even if they're sending a message to their app that I have read this message how is app removing that notification when I don't have background app refresh enabled for FB messenger or FB iOS app.
What you do is after you've sent the notification you want to remove, you send a notification with the message="" and badge=0. I just tested this in a node js application and it removed the previous notification like you are saying.
After testing myself as following, the answer by SnoApps is correct. The tests I described below assumes the account on iPhone is A.
Test 1:
- Send message 1 from B to A => notification shown on iPhone
- A reads message 1 on desktop => notification on iPhone is gone
Test 2:
- Send message 1 from B to A => notification shown on iPhone
- Send message 2 from C to A => another notification shown
- A reads message 1 on desktop => both notifications still exist
- A reads message 2 on desktop => both notifications gone
And I tested WhatsApp and WeChat, all of them using similar way to do this, which is when server count of unread messages becomes 0, send a silent notification with an empty body and badge 0 to iPhone. the iOS will clear the banners for you.