Logout Device

Prev Next

Overview

The Logout Device feature in Android allows developers to manage user sessions and determine whether a user continues receiving push notifications after logging out of the app. This feature ensures a secure and personalized notification experience.

Use Case

  1. Purpose:

    • Stop sending notifications to a device once the user logs out.

    • Protect user data and preferences by clearing session-related information.

  2. Benefits:

    • Prevent notification delivery to unauthorized users.

    • Enhance user privacy and ensure secure handling of push messages.

Implementation Details

  1. Logout Device API:

    • Use the SDK method to log out a device:

      Overview
      
      The Logout Device feature in Android allows developers to manage user sessions and determine whether a user continues receiving push notifications after logging out of the app. This feature ensures a secure and personalized notification experience.
      Use Case
      
          Purpose:
              Stop sending notifications to a device once the user logs out.
              Protect user data and preferences by clearing session-related information.
      
          Benefits:
              Prevent notification delivery to unauthorized users.
              Enhance user privacy and ensure secure handling of push messages.
      
      Implementation Details
      
          Logout Device API:
              Use the SDK method to log out a device:
  2. Behavior After Logout:

    • Ensure the user no longer receives push notifications after logging out.

    • The logout process clears the association between the user and the device.

  3. Re-login Consideration:

    • When a user logs back in, re-register the device for notifications:

      Appoxee.instance().setPushEnabled(true);
  4. Custom Actions on Logout:

    • Optionally, clear additional user-specific data:

      SharedPreferences preferences = getSharedPreferences("user_data", MODE_PRIVATE);
      preferences.edit().clear().apply();

Keep in mind:

  • Test logout functionality to ensure the device stops receiving notifications immediately after logout.

  • Handle network failures gracefully to ensure the logout operation completes reliably.

  • Consider informing users that logging out will stop notifications related to their account.