--- title: "Logout Device" slug: "logout-device" updated: 2024-12-10T13:22:39Z published: 2024-12-10T13:22:39Z canonical: "docs.mapp.com/logout-device" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Logout 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 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: ```java 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: ```java Appoxee.instance().setPushEnabled(true); ``` 4. **Custom Actions on Logout**: - Optionally, clear additional user-specific data: ```java SharedPreferences preferences = getSharedPreferences("user_data", MODE_PRIVATE); preferences.edit().clear().apply(); ``` > [!NOTE] > 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. ## Related - [Push Notifications](/push-notifications.md) - [Set User Identifier](/set-user-identifier.md) - [Silent Push](/silent-push.md)