Open egorfootball opened 2 years ago
I have the same issue. Here are my environments:
I have the same issue, could you solve this issue?
Have the same issue. Anybody found a solution to how to stop pushes from appearing while the app is in foreground?
What happened?
In our project we use:
The build is successful in Unity (XCode) and runs on the device without errors.
On the Android platform everything is working successfully (OneSignal callbacks successfully fire).
Recap
OneSignalExample (SDK 3.0.2) + Firebase (9.1.0) + Mobile Notifications (2.0.2) (make Authorization request) - issue REPRODUCED (OneSignal notifications reach devices BUT callbacks (OneSignal.Default.NotificationOpened, OneSignal.Default.NotificationWillShow) don't fire on iOS).
1.1 Initialization order doesn't matter. I tried several options: -OneSignal initialization (subscribe on the OneSignal callbacks, initialize OneSignal SDK), Firebase initialization (check Firebase dependencies, optional subscribe on the Firebase Cloud Messaging callbacks), Mobile Notifications initialization (make Authorization request) -Firebase initialization, OneSignal initialization, Mobile Notifications initialization -Other options 1.2 Tried on/off different options in the Mobile Notifications project settings ("Enable push notification", "Request Authorization on App Launch", "Register for Push Notifications on App Launch"). It doesn't matter. Following options are default: 1.3 Tried subscribe/don't subscribe on the Firebase Cloud Messaging callbacks (FirebaseMessaging.MessageReceived, FirebaseMessaging.TokenReceived) after Firebase initialization. It doesn't matter. 1.4 If subscribed on the Firebase Cloud Messaging callbacks (FirebaseMessaging.MessageReceived, FirebaseMessaging.TokenReceived) then reproduce issue - device logs would contain log about receiving notification by Firebase Cloud Messaging.
"FCM: Received notification through notification center."
"FCM: userInfo: { aps = { alert = { body = "test2 message"; subtitle = "test2 subtitle"; title = "Test2 Title"; }; "interruption-level" = active; "mutable-content" = 1; "relevance-score" = 0; sound = default; } };"
FirebaseMessaging.MessageReceived callback successfully fires, BUT OneSignal.NotificationOpened callback doesn't fire.
OneSignalExample (SDK 2.14.6) + Firebase (9.1.0) + Mobile Notificatinons (2.0.2) (make Authorization request) - issue NOT reproduced. OneSignal SDK 2.14.6 - previous version used in the our project before update to the OneSignal SDK 3.x.x.
OneSignalExample (SDK 3.0.2) + Firebase (9.1.0) - issue NOT reproduced.
OneSignalExample (SDK 3.0.2) + Mobile Notifications (2.0.2) (make Authorization request) - issue NOT reproduced
OneSignalExample (SDK 3.0.2) - issue NOT reproduced
System information:
I prepared several examples for to simplify the reproduction of the issue:
Steps to reproduce?
What did you expect to happen?
Final application (OneSignalExample (v 3.0.2) + Firebase (v.9.1.0) (Auth, Crashlytics, Cloud Messaging) + Mobile Notification (v 2.0.2) (make Authorization request for receiving device token) works correctly with incoming push notifications - OneSignal callbacks (OneSignal.NotificationOpened, OneSignal.NotificationWillShow) successfully fire.
Unity version
2021.3.5f1
OneSignal Unity SDK version
3.0.2
Platform
iOS
Relevant log output
No response
Code of Conduct