-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Bug]: Implementing Android INotificationServiceExtension
#92
Comments
Hi I have the same problem. It seems to work fine except the timeout error that is logged. Is there any update? |
The last update I have is from OneSignal support on the 9th of February.
|
thank you for your feedback, so if I understand you still have the problem. |
I had come up with a pull request on the previous version (for xamarin). at the time the team member who responded me sayed there was an interest but they had no time to do it themselves, eventually the PR never got merged and xamarin went out of support in the meantime. I will try to look at this problem for this version and come up with a pull request. I have already a good hunch what might be happening . many APIs are not kept in the binding library for the notifications module because they reference type in the other (core) module. |
We are experiencing this problem too. It has nothing to do with the topic, but I can provide the namespace in android:value with ridiculous values like crc64c75c38fa2186e567. Do you know an easy way to do this? |
What happened?
I’m trying to implement Android
INotificationServiceExtension
in a .NET MAUI application using OneSignalSDK.DotNet 5.0.2I have followed the instructions from https://documentation.onesignal.com/docs/service-extensions#android-notification-service-extension
The DotNet SDK does not wrap the Android code, so I must implement the interface from the Android binding project.
I have successfully received the event in both foreground and background and created my own push message using Notification.AdditionalData.
I call
e.PreventDefault()
to suppress the push message created by the OneSignalSDK, however after approximately 30 seconds the following log message is written and there is no "Confirmed" callback to OneSignal.However there is a greater problem with calling
e.PreventDefault()
, push notifications are sent multiple times toINotificationServiceExtension.OnNotificationReceived()
.onesignal_logcat_duplicate_notification.csv
MauiApp1.zip
Steps to reproduce?
What did you expect to happen?
Alternative one
e.PreventDefault()
Q1. How can I use
e.PreventDefault()
and set the event as successfully completed so that:INotificationServiceExtension.OnNotificationReceived()
is only called once for each push notification, avoidRestoring notifications
. (Critical)remoteNotificationReceived timed out
exception is not logged. (Optional)Q2. Are there any plans to implement
INotificationServiceExtension
in SDK so that I don’t need to use the Android.Binding project.Alternative two
notification.setExtender(...)
The OneSignal Android SDK has an interface
IMutableNotification
with asetExtender
method, https://documentation.onesignal.com/docs/service-extensions#step-1-create-a-class-for-the-service-extensionThere is no such method available in the OneSignalSDK.DotNet
IMutableNotification
interface, the interface is empty.Q3. How can i modify the notification before it is displayed by the OneSignalSDK.DotNet?
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: