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]: 5.0.4 Android login creates unsubscription after 2 seconds unless permission is granted #1927

Open
1 task done
johanlantz opened this issue Dec 1, 2023 · 3 comments

Comments

@johanlantz
Copy link

johanlantz commented Dec 1, 2023

What happened?

Just calling login with the Android sdk creates an unsubscribe event after 2 seconds unless the notification permission is granted.

Screenshot 2023-12-01 at 17 00 48

Steps to reproduce?

I used the Flutter example app and pressed login.
In Android it creates a Last Unsubscribed entry after two seconds unless I quickly grant the notification permission.

Same test using the flutter app on an iPhone does not create the Last Unsubscribed event.

What did you expect to happen?

Last Unsubscribed should not be created by just calling login.

OneSignal Android SDK version

5.0.4

Android version

13

Specific Android models

Pixel 7a with Android 14

Relevant log output

No response

Code of Conduct

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

@johanlantz thanks for reporting this! We will investigate.

@PachecoLpG
Copy link

PachecoLpG commented Jan 15, 2024

Same problem here, multiple unsubscribes on different devices, but in my case it is in the flutter sdk

@VitalyTimofeev
Copy link

VitalyTimofeev commented Jan 19, 2024

The same problem with OneSignal 5.1.1 SDK version. We have following code to init sdk:

OneSignal.setConsentRequired(true);
OneSignal.setConsentGiven(true);
OneSignal.initWithContext(this, ONE_SIGNAL_APP_ID);

and following code to request permission after init
(btw we request permission not in application like in the integration guide but in onCreate of main activity):

fun requestPushPermission() { scope.launch { OneSignal.Notifications.requestPermission(true) } }
Here are our findings when testing different cases:

  • if you first install the app being in Canada - your device is unsubscribed just in few seconds after. Delivery statistic shows your devices as "Unsubscribed". Restart of the app changes nothing.
  • if you will connect to European VPN and restart the app - your device is subscribed. Pushes arriving fine
  • if you will disconnect from VPN and restart the app to be in Canada again - your device still subscribed. Pushes arriving fine.

This behaviour appeared after migration from OneSignal 4.8.1 to 5.1.1. Android 14, target API 33

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