customerio / customerio-reactnative

MIT License
23 stars 11 forks source link

add messageRecieved Event Listener in-app messages #234

Closed luihugo closed 6 months ago

luihugo commented 6 months ago

Is your feature request related to a problem? Please describe.

Yes, on our app whenever the app is backgrounded, we check for the app's current state and when the users comes back we request the user to enter their pincode for security purpose. While receiving the in-app messages, the app seems to be put in backgrounded state causing the pincode screen to popup. There is a messageShown event that i could use but I have found this to update after the app is backgrounded

Describe the solution you'd like if there was a method like messageRecieved that would fire once the message is received before the in-app-message is shown then it would be very easy for me to prevent my redirect to pincode when the apps current state changes

Describe alternatives you've considered

Additional context

Shahroz16 commented 6 months ago

Hey @luihugo, thanks for reaching out, and apologize for the inconvenience that you are facing. Currently, we don't have any callback for such a thing, I have created an internal feature request for it. Meanwhile, can you add any kind of flags or check to have a custom implementation that tells you about the app current state and lets you differentiate between both states i.e, the app coming from background vs in-app was shown?

luihugo commented 6 months ago

Thank you @Shahroz16 , Yes I have a workaround

Shahroz16 commented 6 months ago

Awesome, thank you, closing this as FR has been created internally.