OneSignal-XCFramework icon indicating copy to clipboard operation
OneSignal-XCFramework copied to clipboard

Some sort of cache for In App Message triggers

Open keoztiryaki opened this issue 1 year ago • 1 comments

Hello,

In my app, I have 2 screens, Completed Orders and Earnings. Each of these screens have triggers when they are opened. On ViewDidAppear, I set either OneSignal.InAppMessages.addTrigger("screen", withValue: "completed_orders") or OneSignal.InAppMessages.addTrigger("screen", withValue: "earnings")

I create a new In-App Message from OneSignal dashboard with trigger screen=completed_orders and I set "show when triggers are met" and "show every time when trigger conditions are satisfied". I open the app. Go to completed orders screen and voila. It works.

Now I pause this In-App Message from OneSignal dashboard. This time, I create another In-App Message with screen=earnings with the same settings. Then in the app, I go to that screen. Nothing happens. I see in the log VERBOSE: Evaluating in app messages but no payload is received. And then I open completed orders screen again, and previous In-App Message which I paused is still shown.

I waited few minutes to see if there is some sort of cache. Nothing happened. If I kill the app and then re-open it, then it no longer shows In-App Message in completed orders screen and it started to show in earnings screen.

Why is this working like that? We shouldn't force users to kill the app for new settings to take effect.

We are using v5.2.9 latest version of SDK.

keoztiryaki avatar Feb 02 '25 17:02 keoztiryaki

Hi @keoztiryaki thanks for reaching out about how in-app messages are received on the device.

Our documentation under How in-app messages are displayed provide some detail about this. In app messages are fetched from the server on a new session only (meaning the app is cold started or backgrounded for over 30 seconds).

nan-li avatar Mar 09 '25 07:03 nan-li