Skip to content

Personalization implementation for mobile apps with authorization

Davor Komušanac edited this page Dec 5, 2022 · 1 revision

Expected architecture setup of your system

  • mobile app has registration with log-in and log-out functionality
  • (optional) mobile app has user sessions (logged-in user session expires after some time)
  • backend handles authorization process - your platform contains unique IDs of end users
  • you use Infobip's web portal or push API for targeting users over push by their unique IDs or by tags / segments they belong to

Implementation flow

Every installation of mobile app generates new push registration ID. This ID should be connected to unique person ID when authorize/register/log in API call is made from the mobile app towards your backend.

Most common Personalization flow implementation

  1. Subscribe to registrationUpdated event and wait for its invocation -> that's the time when library gets connected to Infobip's backend (push registration ID is generated)
  2. When registration / log in happens -> implement personalize(forceDepersonalize = true) call, if unique ID has changed, over mobile app or backend API.
  3. When log out happens -> implement depersonalize call over mobile app or backend API.
  4. If app has user sessions, your business case might be to either:
    1. keep the user logged in and keep the possibility of sending personalized messages -> in this case you don’t need to implement anything additional or to
    2. log out the user and don’t send personalized notifications since session has expired and another user might use the app -> in this case you need to call depersonalize ver mobile app or backend API when session expires

Person with multiple devices

Our library has by default ability of having multiple devices logged in / connected to one app at the same time by unique ID. If you implement above-mentioned flow, push sent to an external ID, msisdn or e-mail will target all devices connected to that person.

Targeting single primary device of a person over unique ID

For the use case of having only single user being logged in / connected to the app in the same time, you should utilize our primary setting in mobile app or backend API and in API request for sending push.


Terminology

  • personalize - adding unique ID and additional contact information to the end user. End user is anonymous before personalization
  • depersonalize - make device anonymous - detach user data (IDs and other personal data) from it
Clone this wiki locally