1. Documents
  2. iOS SDK

Logging out users on iOS

Once the user has successfully logged in to your app using their LINE account, you can log out the user with the LINE SDK for iOS. To provide a better user experience, we recommend providing a way for users to log out of your app.

Before you begin

Make sure you have completed the following:

Implementing logout

To invalidate the user access token and log out the user from your app, call the logoutWithCompletion method. The success argument is YES if the logout operation succeeds. If the logout operation fails, you can get information about the failure from the error argument. The error argument is nil if the logout operation succeeds.

[apiClient logoutWithCompletion:^(BOOL success, NSError * _Nullable error){
    if (success){
        // Logout Succeeded
    } else {
        // Logout Failed
        NSLog(@"Logout Failed: %@", error.description);

Executing the completion block in a different queue

The logoutWithCompletion method executes its completion block in the main queue. To execute the completion block in a different queue, specify the queue by calling the logoutWithCallbackQueueCompletion method.

[apiClient logoutWithCallbackQueue:dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0)
    completion:^(BOOL success, NSError * _Nullable error){

Related pages

For more information on using the iOS SDK, see the following pages.