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

[Bug]: Push notifications not appear on specific android devices #598

Closed
1 task done
pawegio opened this issue Mar 30, 2023 · 2 comments
Closed
1 task done

[Bug]: Push notifications not appear on specific android devices #598

pawegio opened this issue Mar 30, 2023 · 2 comments

Comments

@pawegio
Copy link

pawegio commented Mar 30, 2023

What happened?

I am not receiving push notifications on specific (not all) android devices. No issues on iOS. Problematic devices are:

  • Samsung Galaxy A12
  • Xiaomi Redmi Note 8

OneSignal Setup is following:

OneSignal.Default.Initialize(appId);

var result = await OneSignal.Default.PromptForPushNotificationsWithUserResponse();
// it returns expected NotificationPermission.Authorized result

if (result != NotificationPermission.Authorized)
    return;

OneSignal.Default.NotificationWillShow += _ => null;
OneSignal.Default.NotificationOpened += OnNotificationOpened;

Steps to reproduce?

1. Install and launch the app.
2. Background the app.
3. Trigger the notification from app server.
4. Push notification is not appearing.

What did you expect to happen?

Push notification is appearing

Unity version

2021.3.17f1

OneSignal Unity SDK version

3.0.8

Platform

Android

Relevant log output

03-30 11:13:27.228  3724  3818 I Unity   : [OneSignal] OneSignal.Default set to platform SDK OneSignalSDK.OneSignalAndroid. Current version is 3.0.8
03-30 11:13:27.228  3724  3818 I Unity   : OneSignalSDK.OneSignal:set_Default(OneSignal)
03-30 11:13:32.804  3724  3818 W OneSignal: appContext set, but please call setAppId(appId) with a valid appId to complete OneSignal init!
03-30 11:13:33.221  3724  4233 I FirebaseApp: Device unlocked: initializing all Firebase APIs for app ONESIGNAL_SDK_FCM_APP_NAME
03-30 11:13:33.222  3724  3778 I WM-WorkerWrapper: Worker result SUCCESS for Work [ id=<ID>, tags={ com.onesignal.OSNotificationRestoreWorkManager$NotificationRestoreWorker } ]

Code of Conduct

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

Thanks for reporting

Could you provide another log with verbose logging by adding OneSignal.Default.LogLevel = LogLevel.Verbose; before OneSignal.Default.Initialize(appId);

Are the devices getting registered on the OneSignal dashboard? If they are, what are the Subscribed statuses of the devices?

@pawegio
Copy link
Author

pawegio commented Jul 7, 2023

Closing this old issue. It was caused by app id mismatch.

@pawegio pawegio closed this as completed Jul 7, 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