-
I get that PushDelegate.OnEntry does not get called on Android. My understanding of "data" notifications and "Notification" notifications is that they are controlled by whether or not you are including the "notification" object in your JSON payload (I am sending these notifications via Azure Notification Hub). Ones without the "notifcation" object could be considered silent. If the app is in the background and the notification is not a silent "data only" one then the Notification goes straight into the System tray. If the app is in the foreground the OS does not send it to the system tray instead it calls the app and in the case of Shiny PushDelegate OnReceived gets called. What I really want is for a Notification Alert to popup when the app is in the foreground or the background. A couple of threads I have read say that I should be sending data only Push Notifications and then in the OnReceived callback creating local notifications. I'm happy with that as an approach but my attempts at creating local notifications still have them just appearing in the system tray! I have tried the Shiny "Notifcation" Samples and they also just go straight to the System Tray
This SO question suggested that I need to create a Channel. I quickly tried that but that still had them going into the System Tray
Can someone please tell me where I am going wrong |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 14 replies
-
Notifications don't really happen if your app is in the foreground (especially on iOS). From purely an android perspective, there may be some channel settings to allow this, but I'm not aware of what they are. You are best to use the foreground events like pushManager.WhenReceived() or in your delegate, send a message for your UI to do something (toast, etc). As an FYI, if you do want to use the channel you've created, you also need to set it on your local notification. In your example code, it isn't being set |
Beta Was this translation helpful? Give feedback.
-
As of the next release 2.5 (currently in preview) - Foreground notifications will be handled by the library again. You will only need to ensure the proper channel is passed (and created). Also, onentry is now working fully by setting the click_action to SHINY_NOTIFICATION_CLICK and setting up an intent filter on your main activity |
Beta Was this translation helpful? Give feedback.
Notifications don't really happen if your app is in the foreground (especially on iOS). From purely an android perspective, there may be some channel settings to allow this, but I'm not aware of what they are. You are best to use the foreground events like pushManager.WhenReceived() or in your delegate, send a message for your UI to do something (toast, etc).
As an FYI, if you do want to use the channel you've created, you also need to set it on your local notification. In your example code, it isn't being set