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

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.

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.

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

Change notification text in Notification Center

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.

Facebook Notification Handler with iPhone application

I have little Confusion regarding my iPhone application. So I hope I got solution from here.
Now My Question is:
Currently I am developing an iPhone application with Facebook user integration. User can send application request to his/her friend as a Facebook notification. If receiver accept that request or click on that request then how should I detect that through my iPhone application? Or is there any way to show that notification in my iPhone application?(Functionality is like get Life by Friends in Candy Crush Game)
Some Points
I have created canvas for application integration with Facebook but there is no any kind of functionality on my application's canvas page. It is totally blank. I just want application on iPhone not on Facebook.
On every click on app invitation notification by receiver I want to give some points to notification sender.
If you have any king of link or document related to this topic then please send me.

iOS 5 remote notification when launching app from dashboard

since iOS 5, notifications are no more intrusive as previous. This is nice, but it seems that users prefer to tap directly on app icon from the Dashboard instead of the (small) banner area or notification center.
In such case, my app cannot get payload from notifications.. Even the 'application didReceiveRemoteNotification' method is not able to get the notification.
Has anyone got the same issue? Do you have any advice?
Thanks
The intention of the push payload is just to display something useful/informative to the user in the alert. Not to actually send data to your app.
So you will need your own web service to provide the data your app needs. Your app should refresh/sync to that service when it launches to get the data.
Example: Instagram. It can push notify you that someone commented on your photo. But it's not actually sending the comment data in the push to display in the app. The comment data is downloaded when you launch Instagram and attempt to view the comment.