I was observing the behavior of the gmail iOS app. When I receive an email the app shows a notification. I have the app closed, it is not running.
But when I read the email on the pc, the notification disappears immediatly on the iPhone. How is it possible to reproduce this behavior in my app? How can I remotely clear the notifications?
Thanks
Whenever the Gmail server detects that the mail has been read a silent push notification with a badge number of 0 is sent to clear the badge value.
I wish that Facebook did that as well.
Related
I have checked the scenario where i got the text messages notifications
on my iPhone device, i read those message from my mac iMessage application then
the notification which is there on the device notification tray are
automatically disappeared.
How does it work?
Facebook does that also.
Possibly it's done with a silent push notification that lets the app know that a specific message has been read?
I was wondering how to remove a remote notification after is has been sent on the receivers end, if the message has been deleted by the sender. Example, if user A sends a message to user B and user A deletes the message before user B sees it on their device.
IMessage does it when you receive a text (iPhone) but open it on another device (mac pro) the iMessage push notification will be removed on the first device (iPhone).
Also, Ive noticed gmail does it, when you receive a push notification of a new email (on iPhone) but you delete it on the gmail web page (mac pro) the push notification will go away on the lock screen or notification center of my device (iPhone).
Any help will be appreciated thank you!
I guess gmail does it by using the background mode for remote notifications, and then responding to these notifications by issuing a local notification.
You can remove local notifications, but not remote notifications.
I cant find a clear answer about this in the Titanium documentation. Is it possible to directly respond to a push notification while the app is killed ?
I know that the callback is called when you open the app trough the push notification. but is there a way to respond when the app is opened manually ?
I tried to use remote-notification as UIBackgroundModes, but this only helps for paused apps.
My goal is to show the push notification in a in-app message center.
You should never rely on push notifications to deliver you payloads, they are too limited for that. If the user receives 5 push notifications and opens the app via the app icon, you will never receive any of the payloads. If he opens the app via one of those notifications you will only receive that payload.
You could use silentpush:
http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Background_Services-section-37539664_iOSBackgroundServices-SilentPush
But the app should always query a back-end to get the actual data. That's how WhatsApp does it as well, as you can see when you open it via a notification it will then still fetch the message(s) form the server.
If the user turned off (assuming the user accepted to receive Push Notification in the app, but went to Settings to turn it off) Push Notification in Settings for an app, does this app still receive data sent in the notification when opening the app. This app does not receive/retrieve/request data in any other way except Push Notification.
The answer is simple: No, it doesn't.
Google Hangout:
You have unread notifications about your hangout chat on your lockscreen.
Open your hangout app on the PC and suddenly all the messages get removed from your lockscreen/unread notifications.
How can this be achieved?
If the device is running iOS 7.0 there's a new type of remote notification that's "silent". Your app receive the notification and make some stuff without presenting something to the user. see https://developer.apple.com/library/ios/releasenotes/General/WhatsNewIniOS/Articles/iOS7.html#//apple_ref/doc/uid/TP40013162-SW1