HomeAppVirality DocsAdvanced ConfigurationsEnabling LogIn/LogOut

Enabling LogIn/LogOut

This is an important callback implementation and it is crucial to app that allow their users to LogIn & LogOut through multiple devices.

This implies that the Referral data, i.e. earnings, rewards, invite codes, etc. should remain aligned to whichever device the user logs in from.

Alternatively, multiple users may login and logout with different email ids on a single mobile device.

In such cases handling fraud becomes a difficult task. Usually, referral programs are designed by treating the mobile device as personal, therefore tightly linked up with a user until the device is reset. With this assumption, all the device parameters are cross checked before rewarding the user. This is to make sure that existing users are not treated as new users.

However, for apps having a Login/Logout feature and allowing multiple users to use the same device, we can’t tightly couple the device with single user. Hence we would struggle if we use device parameters for fraud verification.

To deal with such a situation where multiple user sessions are allowed/expected for the same device, we recommend using OTP i.e. One Time Password checks, to prevent fraud

When implementing the LogOut callback, please mail to us at support@appvirality.com, with:

  • your App Key
  • a short note on your intent to implement LogOut callback

Keep the subject as: {{App_name}} LogOut Feature Implementation

where {{App_Name}} is your App’s name


Logging Out

To help you handle such scenarios, configure this callback for the LogOut action of a user


This will dislodge all the earnings data, and the user tagged Referral details from the app. You may look at this as cleaning up the slate & making it ready for someone new.


Logging In or New Sign-Up

Immediately after the LogOut of the previous user’s session, it is expected that a new user would either sign-up – or may try to sign-in (assuming he already has an account with your app).

When that happens, utilize the Email ID or Login ID, and initialize the SDK – as shown in the below code snippet:

UserDetails userDetails = new UserDetails();

appVirality.init(userDetails, new AppVirality.AppViralitySessionInitListener() {
        public void onInitFinished(boolean isInitialized, JSONObject responseData, String errorMessage) {
                Log.i("AppVirality: ", "Is Initialized " + isInitialized);
                if (responseData != null)
                        Log.i("AppVirality: ", "userDetails " + responseData.toString());


Prerequisites to implementing LogOut callback:

  • Reach out to AppVirality support and ask them for necessary fraud checks to be disabled to allow multiple users to use a single device.
Was this article helpful to you? Yes No