Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question]: How to implement OSRemoteNotificationReceivedHandler #34

Closed
1 task done
nadirbongiovanni opened this issue Jan 24, 2023 · 1 comment
Closed
1 task done
Assignees

Comments

@nadirbongiovanni
Copy link

How can we help?

It seems that it is not possible to make the OSRemoteNotificationReceivedHandler working following the guide on https://documentation.onesignal.com/docs/service-extensions.
It seems impossible to add any piece of code to override a push notification before it is shown in the notification center.
How do I implement this in a .NET MAUI project?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@brismithers
Copy link
Contributor

Hi @nadirbongiovanni . At this time the notification service extension (NSE) does not have a platform-independent way to implement.

On iOS, .NET 6/7 does not yet have tooling support to create an iOS NSE, but we do have an example in our sample project. Specifically, take a look at this project to see how you can set up the NSE for your app.

On Android, you must implement a native NSE via these instructions.

Note there is the OneSignal.Default.NotificationWillShowevent, however that is only called when the app is in the foreground. If you do require overriding a push notification on Android while the app is in the background/closed, would you be willing to share your use case?

Thanks and hope this helps.

@brismithers brismithers self-assigned this Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants