Avoid repeated display of in-app pop-up upon logging out and logging back in

 

Are you seeing your in-app campaign multiple times, even after setting the delivery controls condition to show only once?

Screenshot_2023-02-13_at_10.03.34_PM.png

When can such scenarios occur?

      • When a user has logged in with the same user profile on multiple devices and has performed the trigger criteria on both devices. 
      • If a user logs out and then logs back in to perform the in-app trigger condition. 
      • When you have an application that logs out users due to session expiry or inactivity, they log back in to use the app. 

Why does this happen?

In-apps channel has been designed in a way that we show pop-ups based on the device ID of the user. When you log out, the user is set to an anonymous user and the delivery controls of the device are refreshed. When you log back in, the campaign will be shown again on performing the trigger criteria because the old delivery controls were removed, and the count of maximum times the user can see the campaign was reset to 0.

What is the expected behavior?

According to the design, when you log in with the same user from multiple devices or when you manually log out and log in back again, you will see the campaign once more. This can't be solved. We can avoid showing of campaign multiple times only when the logout is app-initiated and not user-initiated. 

How can you solve this?

If the app logs out a customer due to session expiry or inactivity, they will be shown the campaign again on login. To avoid this, your app must remove the call to MoEngage SDK whenever the user is logged out automatically. You can do so by referring to the following developer documents:

      • For Android, remove the following function from the auto-logout call. Do not call MoE's logout function when you call logout from your end. 
        Kotlin Java
        MoECoreHelper.logoutUser(context)
      • For IOS, remove the following function from the auto-logout call. Do not call MoE's logout function when you call logout from your end.
        Objective C Swift
        [[MoEngageSDKAnalytics sharedInstance] resetUser];

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?