ACC AEP SDK Logon-Logoff

Learn how to handle the registrationToken and stop receiving notifications when a user logs off and then logs back in with a different account on the same mobile device. Update the custom boolean field to identify whether the user is logged in or logged out.

Description description

Environment

  • Campaign Classic
  • Campaign

Issue/Symptoms

In general, we integrate the AEPor Neolane SDKto execute the setPushIdenfitier or registerDevice method to register the token in the campaign and reconcile it to a recipient using a clientId.

If you want to send push notifications to subscribers linked to a profile, in that case, it should be easily achievable by using profiles as filtering dimensions in their workflows. But there is a use case.

You could easily log off, and then it should stop receiving notifications. And later, you could log in with a different account on the same mobile. We believe the registrationToken (in Android at least) is valid after the app has been installed.

We haven’t found any API reference in the AEP SDKto delete or invalidate the registrationToken, so how can we achieve this use case? Not sure if we can emulate it by invoking the setPushIdentifier or registerDevice again or if this has to be handled with the AuthenticationState within the mobileApp code.

Resolution resolution

This scenario is common to a certain extent. During the logoff, they should send the same API used to register the Customer Id, but emptying it, the field userKey will be empty, and the link to the recipient will be cut. That can be done in the login with a userKey populated with a Customer IDlinked to Recipient/Profile. After logout, the Userkey will be emptied.

The Mobile app needs to make a call to ACC on User logout/login to update this info on ACC. We can have a custom boolean field that we use as a flag to identify if an app subscriber is logged in or logged out.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f