OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
625 stars 215 forks source link

[Bug]: Once user_subscription_limit is reached it is not possible to change users #924

Closed arctouch-danielishara closed 3 months ago

arctouch-danielishara commented 4 months ago

What happened?

After reaching the User Subscription Limit with one user (20 subscriptions per User), the SDK gets stuck with that user. Logout, login, and initialization do not work until that user goes below the maximum subscription limit.

Steps to reproduce?

1. Reach the Subscription limit with a particular user by logging in on multiple devices and/or uninstalling and reinstalling the app multiple times. (make sure you are logging in with the same user, i.e., setting the same externalID every time).
2. After reaching this state, the API will start to return the error: "Operation is not permitted due to user having the maximum number of subscriptions assigned". "user_subscription_limit": 20
3. Once the app receives this message, simulate a logout and a login by calling OneSignal.Users.logout() and OneSignal.Users.login(<newExternalID>) this time using a new external ID.
4. Logout and login operations are not triggered. Nothing is sent to the OneSignal API.
5. Closing and reopening the app to trigger the initialization again will still trigger the login on the first externalID (the user that reached the subscription limit) and fail (even if the login is explicitly called with the 'new external ID')

What did you expect to happen?

I expect the app to not be stuck with the user that has reached the user_subscription_limit. OneSignal.logout and OneSignal.login should work normally and switch the user.

OneSignal Flutter SDK version

5.2.2

Which platform(s) are affected?

Relevant log output

flutter doctor                                          
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.2, on macOS 13.6.4 22G513 darwin-x64, locale en-BR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.91.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

Code of Conduct

MohammedShehata commented 3 months ago

Hi @arctouch-danielishara, did you figure out a solution for it? It happen to me on Android and Ios platforms

LiLatee commented 3 months ago

@arctouch-danielishara have you tried to contact OneSignal by contact form?

arctouch-danielishara commented 3 months ago

No, I have not.

nan-li commented 3 months ago

Please contact support@onesignal.com with your app ID, the subscription ID and external ID. We can help resolve this for you.

See this comment for the current solution and what is planned for the future: https://github.com/OneSignal/OneSignal-Android-SDK/issues/2143#issuecomment-2218710776

Please follow that issue for updates.