refreshToken method

Future<AccessToken> refreshToken()

Refreshes the access token.

If the token refresh process finishes successfully, the refreshed access token will be automatically stored in the user's device. You can wait for the result of this method or get the refreshed token with currentAccessToken.

You don't need to refresh the access token manually. Any API call will attempt to refresh the access token when necessary.

This method redirects calls to the LINE SDK for the relevant native platform (iOS or Android). If an error happens in the native platform, a PlatformException is thrown. See PlatformException.code and PlatformException.message for error details.

The LINE SDK implementation differs between iOS and Android, which means error codes and messages can also be different. For platform-specific error information, see LineSDKError (iOS) and LineApiError (Android).

Implementation

Future<AccessToken> refreshToken() async {
  return await channel
      .invokeMethod('refreshToken')
      .then((value) => AccessToken._(_decodeJson(value)));
}