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]: disablePush method is not working properly #623

Closed
3 tasks done
Jos-Sea opened this issue Dec 2, 2022 · 1 comment
Closed
3 tasks done

[Bug]: disablePush method is not working properly #623

Jos-Sea opened this issue Dec 2, 2022 · 1 comment

Comments

@Jos-Sea
Copy link

Jos-Sea commented Dec 2, 2022

What happened?

I'm calling OneSignal.shared.disablePush(true); method in logout function to disable the notifications.
but when i "turn off" the Internet" while method is executing it returns the below logs

E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null 

and after completing the above method execution calling
OSDeviceState? state = await OneSignal.shared.getDeviceState(); method to check if user is subscribed.
state.subscribed which returns false

but in OneSignal console user still shows as "Subscribed / Active"

as we can see in the above logs the method is OneSignal.shared.disablePush(true); is failed
and user is not "OPTED-OUT" from the console.

is there any we can catch any error if OneSignal.shared.disablePush(true); fails
or any way to check if it's completed successfully in console also.

Steps to reproduce?

1.OneSignal.shared.disablePush(false); first enable notifications.
2. Turn off the internet.
3.await OneSignal.shared.disablePush(true); call this method. 
4.wait to finish execution.

What did you expect to happen?

I'm expecting OneSignal.shared.disablePush(false) method to return any error / exception if the method is not executed successfully. and to make sure user is "OPTED-OUT" successfully in console.

OneSignal Flutter SDK version

3.3.2

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null
E/OneSignal(20428): Failed PUT sync request with status code: -1 and response: null
E/OneSignal(20428): Error setting external user id for push with status code: -1 and message: null

Code of Conduct

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

Hello there!

Apologies that we missed this issue. Since it has been some time since originally reported, I'm going to close this issue. If you are still having problems on our latest SDK version, please feel free to submit a new issue and we will be happy to investigate.

Thanks!

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