Skip to content

[Bug]: Receiving inapps after logout #2519

Closed

Description

@Andrew0000

What happened?

I keep receiving inapps 1) after OneSignal.logout() 2) after login with another id (another user)

Steps to reproduce?

- OneSignal 5.4.2
- Do login:
OneSignal.User.addEmail(profile.email)
OneSignal.login(profile.id)
- Send an inapp via test subscriptions - it's shown - ok
- Do logout:
OneSignal.User.removeEmail(previousEmail)
OneSignal.logout()
- Send an inapp via test subscriptions - it's shown - bug
- Do login with another user (email and id)
- Send an inapp via test subscriptions for the previous user - it's shown - bug

What did you expect to happen?

Device should not receive inapps 1) after logout 2) after login with another user

OneSignal Android SDK version

5.4.2

Android version

15

Specific Android models

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. jinliu9508 commented on Jan 13, 2026

    @jinliu9508
    Contributor

    @Andrew0000
    Thanks for the detailed steps and version info!

    After OneSignal.logout() is called, the device becomes an anonymous user again (i.e., not associated with the previous external ID). In that state, the SDK will still receive any in-app messages that target anonymous users or broad audiences that include them.

    To help narrow this down, could you share:

    1. What audience / filter segment is configured for these in-app messages?
    2. Are they targeting “All Users”, a general segment, or something that doesn’t explicitly require an external ID or email?
    3. For the in-app you send “via test subscriptions”, is it targeting the previous external ID/email only, or also eligible for anonymous users / the device in general?

    If the IAM’s audience includes anonymous users (or doesn’t strictly require the previous user identity), then seeing it after logout() and after logging in as a different user would be expected behavior. Once we know exactly how the in-app audience is configured, we can confirm whether this is a bug or just a targeting adjustment that’s needed.

  2. Andrew0000 commented on Jan 14, 2026

    @Andrew0000
    Author

    @jinliu9508
    It's not audience, I'm targeting a specific user (email).

    I'm adding a user to test subscriptions here (it was "Add as Test Subscription"):

    Image

    Send via that button:

    Image

    Then I select the test subscription and send via "Send Test Push":

    Image

    And I keep receiving InApps after 1) logout 2) login with another user/email

  3. nan-li commented on Apr 10, 2026

    @nan-li
    Contributor

    Hi @Andrew0000, the test subscriptions are for testing and debugging purposes. Since it is "Add as Test Subscription", the push subscription itself is the target, so if you logout and login, you are still going to target the same device.

    Let me know if you have any further issues and I'll take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions