Change notification text in Notification Center - notifications

i am developing an iOS app which receive push notification from GCM server. I need to change the message received from push notification server to "You have received n notification" where n will be number of notification received from push server.
Is there is a way to perform this action?
If yes, then how should i do it?

The short answer is yes, but you must maintain the count of unopened notifications yourself. You could have your app send a HTTP request to your server when the app opens, to set to zero the message count on your server, which will increment with each new message till the app is opened and the value is reset. So when you send a new message you can include the incremented value in the message.

Related

Expo/React Native : A Continuous Alarm or Sound Notification (like receiving a call ) triggered by remote server

I am using Expo to build an app that will pop up a notification with custom sound and vibration when triggered remotely. The alarm/vibration would play until its dismissed by the user or it times out (say after 1-2 mins) .
Example use case would be when a partner needs my immediate help with baby, they can press a button the app and that would send signal to backend server which would then trigger the notification with alarm on the app at the other end. When the notification is dismissed, an acknowledgement message is sent with Yes or No type message. If the notification times out, then another message is sent like "no response".
Key point to note is that when the app is fully closed, the notification should still be able to pop up.
From my limited understanding , expo notification or push notifications in general cannot achieve this as they don't allow us to create notifications that directly open the app. Even a solution which works like phone or video calling apps (which open when someone calls you ) could work.
Any help would be much appreciated.
Many Thanks!
I looked up expo push notifications but they are limited in terms of customising the notifications.

Ionic 4 Firebase Pushnotification

I need to know is it possible to need to send some type ID with firebase notification. Where user get notification i want to open the page and pass that ID as a parameter in api ? Is it possible ? OR any one have example ? Thanks
Depending on your need you can send a notification message, or data message, the notification message will be basically responsible for showing a push notification to the device with a title, subtitle and message depending on the operating system (in terms of the graphic environment), the data message will send a notification to the device with the data you want, this notification will not be visible to the user, now if you need to send data but also show a notification to the user you can do it in two ways:
You send a notification of data, when you receive it you process it, you show a local notification and you send by parameter the id that you received.
Send a push notification (with the id specifically in some side as you wish) this is shown by default to the user, when the user opens it, you process the id, and send it by parameter.
I recommend the first option, here you will find more information
Firebase Cloud Messaging

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.

How to update a Parse push notification instead of creating a new one

With my app, the Parse module sends out a notification each time a picture is sent to the Android recipient. The recipient then know to login to the app and receive the picture. My problem is that if the same recipient is getting many pictures sent to him, he will get many notifications for the app. Is there a way to update any existing Parse notification on and Android device to show the waiting count, instead of sending multiple notifications? I have searched through Parse documentation and here at Stackoverflow but can't find any info on how to do this.
yes, I am facing the same problem, The resolution is that , if you dont send title and alert in parse notifications, it will not create the automatic notifications in the device, so you will have to handle them in your broadcast receiver and create your own notifications, you can have a NOTIFICATION_ID for each notification you create and update the count by getNumber and setNumber i think.
here is a link
https://www.parse.com/questions/update-notification-in-android
Update: Sorry for getting back to you late on this but this might help someone else. Even If your app is not running, You will still get the notification. I have tested it on my own BroadcastReceiver which generates Modified notifications with bitmap, and positive, negetive button for response.

Updating application icon Badge in iPhone 3.0, when application is not running

I have an application, which lists number of IM sent by any of my friend using my application. And application icon show number of unread IMs to me. If my application is running in foreground, I can update badge by calling web service every 1 minute which will return number of unread IMs. Suppose, if the person is using iPhone3.0 and application is not running, how can i update the badge? Push notification without alert, but with just number of unread IMs as badge number will work?
Please advice, Thank you.
Yes if the user enables push notifications and allowes it for your app then you can use them to just adjust the badge counter.
At last, we found the problem, the problem is passing badge parameter as string in JSON payload, Now we are sending it as number, so even when the application is in background, badge getting set properly.
Thank you for your all help.