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]: removeSms and removeEmail do not work after logout user #840

Open
3 tasks done
inesga opened this issue Feb 21, 2024 · 5 comments
Open
3 tasks done

[Bug]: removeSms and removeEmail do not work after logout user #840

inesga opened this issue Feb 21, 2024 · 5 comments

Comments

@inesga
Copy link

inesga commented Feb 21, 2024

What happened?

I'm using OneSignal 5.1.0 to subscribe users and get data in my flutter app.
When I use other session to save / remove data, the removeEmail and removeSms don't remove the subscriptions.
Testing with the rest requests, everything works fine, but not using the api call.

My flutter doctor:
[✓] Flutter (Channel stable, 2.10.5, on macOS 14.2.1 23C71 darwin-arm, locale en-PT)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] Connected device (3 available)

Api methods called:
OneSignal.User.removeSms(_smsNumber);
OneSignal.User.removeEmail(_email);

Steps to reproduce?

OneSignal 5.1.0

My flutter doctor:
[] Flutter (Channel stable, 2.10.5, on macOS 14.2.1 23C71 darwin-arm, locale en-PT)
[] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[] Xcode - develop for iOS and macOS (Xcode 15.1)
[] Chrome - develop for the web
[] Android Studio (version 2023.1)
[] Connected device (3 available)

Steps:
- initialize OneSignal in app;
- start a user sesssion and add email, sms and tags to subscription (calls login and then the methods to add email, sms and tags);
- end session in app -> call logout() in onesignal api;
- start new session with same user and change preferences to unsubscibe emails and sms (calls removeSms and removeEmail) -> no error is reported but the email and sms records are not removed

What did you expect to happen?

I expected the api to remove email and sms data from onesignal.

OneSignal Flutter SDK version

5.1.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

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

nan-li commented Feb 21, 2024

Hi @inesga,

start new session with same user and change preferences to unsubscibe emails and sms (calls removeSms and removeEmail) -> no error is reported but the email and sms records are not removed

When you say "start new session with same user", are you logging the user back in before calling removeSms and removeEmail?

If not, this is expected behavior. After you call logout, that user is no longer in the SDK and cannot be operated on.

@inesga
Copy link
Author

inesga commented Feb 21, 2024

When I say "start new session with same user" I do call login. The api methods are called this order:

  1. login
  2. add email
  3. add sms
  4. add tags
  5. ...
  6. logout
  7. login (again)
  8. (change user settings)
  9. removeEmail
  10. removeSms
  11. removeTags

If I remove email and sms in the first session (before point 6), everything goes well, but when I logout and login again, noting happens. This also happens if I login with the same user in other phone.

@nan-li
Copy link
Contributor

nan-li commented Feb 23, 2024

Hi @inesga thank you for the additional details. I will try to reproduce with those steps and reach out with any questions.

This is happening 100% of the time for you with these steps?

@inesga
Copy link
Author

inesga commented Feb 23, 2024

This is happening 100% of the time for you with these steps?

I suppose so, yes.

@jennantilla
Copy link
Contributor

Hello there--apologies that this issue has gone stale. Is this still an issue for you?

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

3 participants