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]: "App crashes when opening grouped notifications with different content in Xamarin Forms using OneSignal SDK" #378

Closed
sarapura12 opened this issue Apr 17, 2023 · 5 comments

Comments

@sarapura12
Copy link

sarapura12 commented Apr 17, 2023

I am experiencing an issue with the grouping of notifications. We are sending notifications to devices using the OneSignal API, which includes headings, contents, android group, and android group message. The notifications that are grouped have different contents. When we try to open the grouped notification in the Android app, it throws a


NullReferenceException with the message "Object reference not set to an instance of an object." 
NativeConversion.NotificationToXam (Com.OneSignal.Android.OSNotification notification)
NativeConversion.NotificationOpenedResultToXam (Com.OneSignal.Android.OSNotificationOpenedResult result) OneSignalImplementation+OSNotificationOpenedHandler.NotificationOpened (Com.OneSignal.Android.OSNotificationOpenedResult notificationOpenedResult)
OneSignal+IOSNotificationOpenedHandlerInvoker.n_NotificationOpened_Lcom_onesignal_OSNotificationOpenedResult_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_p0)
JNINativeWrapper.Wrap_JniMarshal_PPL_V (_JniMarshal_PPL_V callback, System.IntPtr jnienv, System.IntPtr klazz, System.IntPtr p0)

This only happens when notifications with different contents are grouped. We want to be able to open the grouped notification without the app crashing and perform some actions based on the additional data sent with the notification. We have only implemented the SharedPush from the example in the repository.

How can we help?

@emawby
Copy link
Contributor

emawby commented Apr 17, 2023

@sarapura12 Thank you for reporting we will investigate. Which version of the OneSignal Xamarin SDK are you using?

@sarapura12
Copy link
Author

@sarapura12 Thank you for reporting we will investigate. Which version of the OneSignal Xamarin SDK are you using?

Thank you for looking into the issue. I am currently using v4.3.0.

@sarapura12
Copy link
Author

sarapura12 commented May 30, 2023

@emawby l have resolved the issue by updating to version 4.3.4. Additionally, I found that the 'android_group_message' field was being sent as a string, but now I am sending it as an object. {"en": "You have $[notif_count] new messages"}
However, even after grouping the messages, the Android group message that I send does not appear. The messages are simply grouped with their title and heading.

@emawby
Copy link
Contributor

emawby commented Jun 12, 2023

Got it thank you for the update. We will investigate issues around grouping

@shepherd-l
Copy link

Is the issue that the grouped messages are not appearing as "You have $[notif_count] new messages”?

What are the Android versions of the devices you are seeing this issue on?

The property android_group_message only applies to devices on Android 6 and older.
We also talk more about it here: https://documentation.onesignal.com/docs/notification-grouping#android-notification-grouping

If that isn't the case, could you also provide the message body you sent through the API and the response

@nan-li nan-li closed this as completed Oct 24, 2024
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

4 participants