Skip to content

[Bug]: In-App Message trigger fires immediately on iOS but requires app focus change on Android #867

@uneebkari-stack

Description

@uneebkari-stack

What happened?

On iOS, when a custom trigger is added via OneSignal.InAppMessages.AddTrigger(key, value) and the trigger condition is met, the In-App Message displays immediately as expected.

On Android, the exact same trigger does not display the IAM immediately. The message only appears after the user changes app focus (backgrounds and foregrounds the app — a new session is not required, just a focus change). This is inconsistent behavior between platforms for the same SDK call.

Unity Version 2022.3.62f2
OneSignal Unity SDK Core 5.1.12
OneSignal Unity SDK Android 5.1.12
OneSignal Unity SDK iOS 5.1.12
Platform affected Android only

Steps to reproduce?

Create an In-App Message in the OneSignal dashboard with a custom trigger (e.g. key = "myTrigger", value = "true")
In your Unity app, call OneSignal.InAppMessages.AddTrigger("myTrigger", "true") at runtime
On iOS → IAM displays immediately ✅
On Android → IAM does not display. Background the app and bring it back to foreground → IAM now displays ❌

What did you expect to happen?

The In-App Message should display immediately on Android when the trigger condition is met, the same way it does on iOS. No focus change should be required.

Unity version

Unity Version 2022.3.62f2

OneSignal Unity SDK version

Unity SDK 5.1.12

Platform

Android

Relevant log output

Code of Conduct

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

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