shiny: Android PushDelegate OnEntry never called for push notification
ONLY active OSS maintainers of other projects OR ACTIVE project sponsors can ask questions here. If you don’t do either of these things - DO NOT FILE HERE OR THIS WILL BE CLOSED! THERE IS NO SUPPORT ON PREVIEW/BETA VERSIONS!
Give as much details as humanly possible if you want any sort of answer!
Enter Question Below (don’t delete this line) Hey Allan,
Got another question. I was testing the push notifications on Android (using Azure Notification Hub) and I can’t get the PushDelegate.OnEntry method triggered when a notification is received via push and the app is in the background. I’ve debugged the code and the check for the IntentNotificationKey is always false when it’s a push notification (see permalink below). The IntentNotificationKey is only set when the notification is shown via the Shiny NotificationManager. Is this a bug or expected behavior?
https://github.com/shinyorg/shiny/blob/b33f1ac410861b47a2518e5e9c660f4a15e3c7ca/src/Shiny.Notifications/Platforms/Android/AndroidNotificationProcessor.cs#L34
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 22 (12 by maintainers)
Commits related to this issue
- Initial work for #656 - separating processing components for local notifications — committed to shinyorg/shiny by aritchie 3 years ago
- Fix #656 - onEntry is only processed by incoming intent - platform still needs to change the way the intent is being broadcast — committed to shinyorg/shiny by aritchie 2 years ago
Thanks - will look into it for 2.2
This is now fixed and will be available in preview builds now week. Nothing special will be required from the server side.
The delegate and the info provided to the delegate may see the notification object removed. This is still being debated. You will still be given the payload data which is what most should be after anyhow.
This has been an extremely hard issue to solve for all platforms especially Android. I think I’m going to remove the ability to try and deal with actions from push altogether. There will also be a requirement for android push to include the clickaction in the payload to link to the Shiny push intent on open which would allow Shiny to work with OnEntry.
If you need something with actions (buttons on the notification or any sort of customization), you need to send a silent push with the necessary details and use Shiny.Notifications to customize and deal with the OnEntry. By doing this, I can simplify the necessary mechanics for push.
This didn’t make it into 2.2 only because it isn’t a simple fix. It is a priority, but I needed more time to figure out to approach this.