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]: App still receives notifications for the previous external ID if I call OneSignal.logout() and OneSignal.login() for other external ID #1730

Open
3 tasks done
reinevan opened this issue Aug 15, 2024 · 6 comments

Comments

@reinevan
Copy link

reinevan commented Aug 15, 2024

What happened?

I have a React Native Expo application where I use react-native-onesignal v 5.2.0 to receive push notifications. In the app users can log in / log out:

  • When the user logs in, I invoke:

OneSignal.login(externalId)
OneSignal.User.addEmail(emailAddress)
OneSignal.User.addTag('email', emailAddress)
OneSignal.User.addTag('phone', phoneNumber)

When the user logs out, I invoke:

OneSignal.logout()

When some updates happen on the backend, I send push notifications to related users using "include_external_user_ids" field in the REST API call.

The scenario is as follows:

User A logs in, the app receives push notifications sent to User A.
User A logs out.
User B logs in.

As the result the app does NOT receive push notifications for User B, but still receives notifications for User A.

Steps to reproduce?

1. Call OneSignal.initialize(OneSignalAppId)
2. Call OneSignal.login(externalIdA)
3. Send some push notifications for externalIdA, test that they are received on your device
4. Call OnSignal.logout()
5. Call OneSignal.login(externalIdB)
6. Send some push notifications for externalIdB, test that they are NOT received on your device
7. Send some push notifications for externalIdA, test that they are received on your device

What did you expect to happen?

I expected app to stop receiving push notifications for external ID if I invoked OneSignal.logout() and want to receive push notifications for external ID if I invoked OneSignal.login(externalId).

React Native OneSignal SDK version

Release 5.2.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
@jennantilla
Copy link
Contributor

Hello @reinevan thanks for reaching out! Could you please share the debug log reproducing this behavior? Thanks!

@BrantK
Copy link

BrantK commented Aug 29, 2024

I am seeing the same issue. Is there a workaround for this?

@reinevan
Copy link
Author

Hello @reinevan thanks for reaching out! Could you please share the debug log reproducing this behavior? Thanks!

Thanks for looking at it! Please find the log attached:

onesignal.txt

@SKHRAPP
Copy link

SKHRAPP commented Sep 30, 2024

@jennantilla any update from this issue still getting previous employee notification after oneginal.logout()

@zguo123
Copy link

zguo123 commented Oct 8, 2024

I am also facing the same issue. I would love a solution asap!

@nan-li
Copy link
Contributor

nan-li commented Oct 8, 2024

Hi @reinevan thank you for the logs. I see the issue is that the first login(externalId: 1eafc97a-9612-4bd1-bb98-a3610570f49d) encountered a tag entitlement error. Therefore, the subsequent logout and login(externalId: b780b91c-e302-4079-b41b-e6d945122a02) are blocked and they don't actually successfully logout and login to those users.

POST - STATUS: 409 - Body: {"errors":[{"code":"entitlements-tag-limit","title":"The tags for this user exceed the limit for this organization's plan. Please remove existing tags or upgrade your plan to add more tags"}]}

You marked this as affecting both Android and iOS, can you confirm you also experienced this behavior on iOS?

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

6 participants