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

App is in closed state tapping on notification not getting any data with 4.1.2 #324

Open
MATAUDI opened this issue Jul 23, 2022 · 11 comments

Comments

@MATAUDI
Copy link

MATAUDI commented Jul 23, 2022

Description:

App is in closed state on Android tapping on notification NotificationOpened not getting fired, failed to captured additional data passed on to notification for deep linking.
OneSignal.Default.NotificationOpened += _notificationOpened;

Environment

Xamarin Forms 5.0.0.2125
Install OneSignalSDK.Xamarin 4.1.2 (all the projects)

Steps to Reproduce Issue:

Use Case 1: (It does not work correctly)

  1. Build app and swipe away, app is in closed state
  2. Send push notification from OneSignal Portal, with additional data
  3. OneSignal.Default.NotificationOpened += _notificationOpened; not getting called in closed state

Use Case 2: (Works correctly)

  1. Build app, app is in background/foreground
  2. Send push notification from OneSignal Portal, with additional data
  3. OneSignal.Default.NotificationOpened += _notificationOpened; getting called in app is in background/foreground
@MATAUDI
Copy link
Author

MATAUDI commented Jul 26, 2022

@jkasten2 any news on this? Do you have any idea what could be causing this to happen?

@MATAUDI
Copy link
Author

MATAUDI commented Aug 3, 2022

@tanaynigam @jkasten2 any news on this? Do you have any idea what could be causing this to happen?

@tanaynigam
Copy link
Contributor

@MATAUDI I have been unable to reproduce the issue. Is it possible for you to provide me with the details regarding the additional data passed in the notification for deep linking?

@MATAUDI
Copy link
Author

MATAUDI commented Aug 16, 2022

@tanaynigam I don't use deep link, I use "NotificationOpened" to capture the additional data that is sent from OneSignal (key, value)... when I want to take that additional data with the app closed (without being in the background) I can't capture it, it does not enter "NotificationOpened".

@twelve-cgn
Copy link

twelve-cgn commented Dec 2, 2022

Here the same. We are currently migrating from Com to SDK. This is the last big problem that prevents the current delivery. However, this is only happening on iOS for us. On Android, everything seems to be running as before.
If the app was closed (by task), then on iOS the NotificationOpened is not called. On Android it is.

Environment

Xamarin Forms 5.0.0.2125
Install OneSignalSDK.Xamarin 4.3.0 (all the projects)

@Dfergy
Copy link

Dfergy commented Dec 21, 2022

I'm commenting here as I have the same issue. I put up a question too, I see several like this and all seem to be going with no replies. It is also delaying a delivery for me, Android only.

Xamarin Forms 5.0.0.2515
OneSignalSDK.Xamarin 4.3.0

@fatderda
Copy link

Found a solution (Android 13) that fixed it for me:
#315 (comment)

@fhboswell
Copy link

fhboswell commented Dec 29, 2022

I was able to reproduce the issue that you have been experiencing @MATAUDI. I have tested @fatderda's solution and it works.
If your NotificationOpened handler is not firing on cold start put the NotificationOpened handler before the OneSignal initialization.

OneSignal.Default.NotificationOpened += HandleNotificationOpened;
OneSignal.Default.Initialize(<OneSignalAppId>);

@twelve-cgn
Copy link

I still don't get the event when the app was closed on iOS. When clicking the Notification the App opens, but after binding the event nothing happens. On Android it works as suspected.

I doesn't matter when the event was bound. I tried it as one of the first lines and after the initialization.

@twelve-cgn
Copy link

twelve-cgn commented Mar 6, 2023

Is it mandatory to add a Notification Service Extension for iOS? I don't use it, because so far (before the upgrade) it worked without it. I can't deliver our product this way because important data is not updated when the notification is opened.

What must/can I do to finally get the meta data or the event?

FYI: I'm using Xamarin.Forms 5.0.0.2545 not a Single View App and OneSignalSDK.Xamarin 4.3.2

@twelve-cgn
Copy link

Nothing changed with 4.3.3.
I have now also tried to bind the NotificationOpened event before and once after the Initialize method. Both are not called after the cold start.

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

6 participants