I want implement Safari Push Notifications In the documentation , there is a Handling permissions for website push notifications section for getting APNs token
But there is no way to get the notification , I need to get notification payload as it contains custom data, How can I get remote notification payload? is there any listener like onMessage?
Related
I have integrated OneSignal in ReactNative, now i am able to send and receive notifications. But after once notification is received into the mobile, then and there itself from the notification tray if user clears the notification without clicking it. Do we have any option to get all un-read notifications either with player_id and app_id
Looks like we can read the messages once we click on the notification which re-directs to the application.
I expect onesignal notifications should to able to retrieve the list of un-read notification using react-native sdk.
Can Someone help me with your ideas
Thanks.
I want to know why Firebase Cloud Messaging doesn't send notifications when the app is running?
I started my application and tried to send a message. When I closed my application, it notified me. But when and I opened it and sent another notification, it didn't notify me, but it did trigger onMessage.
Is it possible to notify me when my application is running?
Firebase Cloud Messaging has two types of messages: notification messages and data messages.
Data messages are used for delivering data to your app. They are always delivered to your application's onMessage handler.
Notification messages are used to show a notification to the user. When your app is active, the messages are delivered to its onMessage handler, so that you can display the notification inside the app. But when the app is not active, notification messages are handled by the system and not delivered to your app's onMessage handler.
It sounds like you're sending a notification message. If you always want the message to be delivered to your applications onMessage, you should send a data message instead.
Also see:
the Firebase documentation on message types
Firebase onMessageReceived not called when app in background
When my service worker invokes a secured API that returns content, I do receive an error message, such that The Site has been updated in background. Can anyone please help me out ?
Based from this link, the message This site has been updated in the background is a forced message from the Chrome browser when the SDK cannot fetch the notification contents to retrieve. Notification contents are not sent to our background worker; instead we receive a signal to display a notification and then we fetch the notification contents from our server.
This behavior is most likely triggered by the user having multiple notifications pings, but only one message to receive.
You may also check this related SO post: Chrome Push Notification: This site has been updated in the background
Generally as soon as you receive a push message from GCM (Google Cloud Messaging) you have to show a push notification in the browser. This is mentioned on the 3rd point in here:
https://developers.google.com/web/updates/2015/03/push-notificatons-on-the-open-web#what-are-the-limitations-of-push-messaging-in-chrome-42
So it might happen that somehow you are skipping the push notification though you got a push message from GCM and you are getting a push notification with some default message like "This site has been updated in the background".
Hope this helps!
I previously setup an Appcelerator Titanium project with push notifications (as per my Stack Overflow question How to configure Android Push Notifications (GCM) in Appcelerator Titanium Dashboard?) and for some months my Android app has been receiving the appropriate push notification from GCM, but I'm now receiving reports that this no longer works from end-users.
The flow usually goes like this...
Android app sends android push token to my Java server
Java server persists the Android push token
Java server sets up Amazon Web Service SNS endpoint for GCM and stores this endpoint for later use.
(some time passes)
Java server invokes Amazon Web Service SNS endpoint with a GCM payload
Amazon SNS passes message to Google GCM
GCM passes message to ti.cloud / ti.cloudpush
Phone displays push notification
The app does receive the push notification and I display an application dialog to show the contents of the message, but NO system-tray push notification is displayed, whereas I thought it was doing this in the past. No system sound is played either.
I can see that if the app is not running, then when the push notification is received the app is launched, but if the display isn't on (or locked) then the message will not be discovered for some time. I really need the native/system push notification to be in the tray.
Does anyone know why system / status notifications are not displayed? Should it be when using the ti.cloud / ti.cloudpush for Android?
Thanks
Rob.
I create an android gcm client. I read this guide:
https://developers.google.com/cloud-messaging/android/client and i use this example https://github.com/googlesamples/google-services/tree/master/android/gcm
My app workes, it receives Push but only when our server application sends json with "data payload".. when our server sends json message with notification payload my android app does'nt receive push.
I read: "Use notifications when you want GCM to handle displaying a notification on your Android client app’s behalf," but it doesn't work in Android...
From what I can guess, you probably just don't have the icon key in your json which is required for Android but not for iOS, try to add something like "icon" : "#drawable/myIcon.png" in your notification dictionary. (I would have asked for a sample of your Json in the comment instead of guessing if I could but I'm still pretty new and can't comment everything yet).