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 214 forks source link

[Bug]: Continues Login and logout not working properly. #923

Open ilyasarafathemvigo opened 4 months ago

ilyasarafathemvigo commented 4 months ago

What happened?

While trying a login and logout with two more times , the subscription status got "Not subscribed" and notification is not receiving . Same thing like if try continues login and logout, am getting notification after logout.

Steps to reproduce?

1. call this function  OneSignal.login(userId);
2. Then OneSignal.logout()
3. wait 2 seconds 
4. call this function  OneSignal.login(userId);
5. Then OneSignal.logout()

What did you expect to happen?

The notifications get properly based on login and logout .

OneSignal Flutter SDK version

5.2.1

Which platform(s) are affected?

Relevant log output

No response

Code of Conduct

affan3699 commented 3 months ago

Yes facing same issue. the login and logout does not update the external id on onesignal dashboard when done frequently.

nan-li commented 3 months ago

Hi @ilyasarafathemvigo and @affan3699,

Thanks for reporting. It is hard to tell what may be happening.

We would need verbose-level logs that capture these steps taken.

Please set OneSignal.Debug.setLogLevel(OSLogLevel.verbose) before you call OneSignal.initialize("YOUR_ONESIGNAL_APP_ID") to capure these logs.

stralz commented 3 weeks ago

Same here, any updates?

stralz commented 3 weeks ago

D/OneSignal(18884): [main] initWithContext(context: com.si_cleaning.ca.MainActivity@d6a1146, appId: xxxx-xxxx-xxxx-xxxx-xxxx) D/OneSignal(18884): [main] initWithContext: SDK already initialized D/OneSignal(18884): [main] Retrieving service interface com.onesignal.inAppMessages.IInAppMessagesManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.inAppMessages.internal.InAppMessagesManager@e79f379 D/OneSignal(18884): [main] InAppMessagesManager.addLifecycleListener(listener: com.onesignal.flutter.OneSignalInAppMessages@ab1b8be) D/OneSignal(18884): [main] Retrieving service interface com.onesignal.inAppMessages.IInAppMessagesManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.inAppMessages.internal.InAppMessagesManager@e79f379 D/OneSignal(18884): [main] InAppMessagesManager.addClickListener(listener: com.onesignal.flutter.OneSignalInAppMessages@ab1b8be) D/OneSignal(18884): [main] Retrieving service interface com.onesignal.user.IUserManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.UserManager@4e9bd1f D/OneSignal(18884): [main] Retrieving service interface com.onesignal.user.IUserManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.UserManager@4e9bd1f D/OneSignal(18884): [main] Retrieving service interface com.onesignal.notifications.INotificationsManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.notifications.internal.NotificationsManager@ba3ea2f D/OneSignal(18884): [main] Retrieving service interface com.onesignal.notifications.INotificationsManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.notifications.internal.NotificationsManager@ba3ea2f D/OneSignal(18884): [main] Retrieving service interface com.onesignal.user.IUserManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.UserManager@4e9bd1f D/OneSignal(18884): [main] Retrieving service interface com.onesignal.notifications.INotificationsManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.notifications.internal.NotificationsManager@ba3ea2f D/OneSignal(18884): [main] NotificationsManager.addForegroundLifecycleListener(listener: com.onesignal.flutter.OneSignalNotifications@fc03117) D/OneSignal(18884): [main] Retrieving service interface com.onesignal.notifications.INotificationsManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.notifications.internal.NotificationsManager@ba3ea2f D/OneSignal(18884): [main] NotificationsManager.addPermissionObserver(observer: com.onesignal.flutter.OneSignalNotifications@fc03117) D/OneSignal(18884): [main] Retrieving service interface com.onesignal.user.IUserManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.UserManager@4e9bd1f D/OneSignal(18884): [main] Retrieving service interface com.onesignal.user.IUserManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.UserManager@4e9bd1f D/OneSignal(18884): [main] ApplicationService.onActivityPaused(1,APP_OPEN): com.si_cleaning.ca.MainActivity@d6a1146 D/OneSignal(18884): [main] ApplicationService.onActivityResumed(1,APP_OPEN): com.si_cleaning.ca.MainActivity@d6a1146 D/OneSignal(18884): [main] logout() D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] createAndSwitchToNewUser() D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.subscriptions.SubscriptionModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.subscriptions.SubscriptionModelStore@fe3ea6b D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.application.IApplicationService D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.application.impl.ApplicationService@409d557 D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.application.IApplicationService D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.application.impl.ApplicationService@409d557 D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.subscriptions.SubscriptionModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.subscriptions.SubscriptionModelStore@fe3ea6b D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.properties.PropertiesModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.properties.PropertiesModelStore@4f794e5 D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.operations.IOperationRepo D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.operations.impl.OperationRepo@6113be3 D/OneSignal(18884): [main] OperationRepo.enqueue(operation: {"name":"transfer-subscription","appId":"xxxx-xxxx-xxxx-xxxx-xxxx","subscriptionId":"b84adb8b-0337-44e0-bf1b-7433043da2a3","onesignalId":"local-cceddd44-f122-40c8-acf9-b13676691bf9"}, flush: false) D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.subscriptions.SubscriptionModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.subscriptions.SubscriptionModelStore@fe3ea6b D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.operations.IOperationRepo D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.operations.impl.OperationRepo@6113be3 D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] OperationRepo.enqueue(operation: {"name":"login-user","appId":"xxxx-xxxx-xxxx-xxxx-xxxx","onesignalId":"local-cceddd44-f122-40c8-acf9-b13676691bf9"}, flush: false) D/OneSignal(18884): [main] Retrieving service interface com.onesignal.notifications.INotificationsManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.notifications.internal.NotificationsManager@ba3ea2f D/OneSignal(18884): [main] NotificationsManager.addClickListener(handler: com.onesignal.flutter.OneSignalNotifications@fc03117) D/OneSignal(18884): [main] logout() D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] login(externalId: 3, jwtBearerToken: null) D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] createAndSwitchToNewUser() D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.subscriptions.SubscriptionModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.subscriptions.SubscriptionModelStore@fe3ea6b D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.application.IApplicationService D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.application.impl.ApplicationService@409d557 D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.application.IApplicationService D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.application.impl.ApplicationService@409d557 D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.subscriptions.SubscriptionModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.subscriptions.SubscriptionModelStore@fe3ea6b D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.properties.PropertiesModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.properties.PropertiesModelStore@4f794e5 D/OneSignal(18884): [main] Retrieving service interface com.onesignal.core.internal.operations.IOperationRepo D/OneSignal(18884): [main] Already instantiated: com.onesignal.core.internal.operations.impl.OperationRepo@6113be3 D/OneSignal(18884): [main] OperationRepo.enqueue(operation: {"name":"transfer-subscription","appId":"xxxx-xxxx-xxxx-xxxx-xxxx","subscriptionId":"b84adb8b-0337-44e0-bf1b-7433043da2a3","onesignalId":"local-d5f28b00-46b4-4d00-ad98-2de038cd6499"}, flush: false) D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.subscriptions.SubscriptionModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.subscriptions.SubscriptionModelStore@fe3ea6b D/OneSignal(18884): [main] Retrieving service class com.onesignal.user.internal.identity.IdentityModelStore D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.identity.IdentityModelStore@7509bdc D/OneSignal(18884): [Thread-38] Retrieving service interface com.onesignal.core.internal.operations.IOperationRepo D/OneSignal(18884): [Thread-38] Already instantiated: com.onesignal.core.internal.operations.impl.OperationRepo@6113be3 D/OneSignal(18884): [Thread-38] OperationRepo.enqueueAndWait(operation: {"name":"login-user","appId":"xxxx-xxxx-xxxx-xxxx-xxxx","onesignalId":"local-d5f28b00-46b4-4d00-ad98-2de038cd6499","externalId":"3","existingOnesignalId":"local-cceddd44-f122-40c8-acf9-b13676691bf9"}, force: false) D/OneSignal(18884): [main] Retrieving service interface com.onesignal.user.IUserManager D/OneSignal(18884): [main] Already instantiated: com.onesignal.user.internal.UserManager@4e9bd1f Here are my logs. Same stuff on my end, when frequently loggin in and logging out while testing on the same device with different users im getting not subscribed on the admin, no notifications are popping up, when sending the notification from the other device it isnt loggin anything.