MLWeiboAccessToken Class Reference

Inherits from NSObject
Declared in MLWeiboAccessToken.h

Overview

@class MLWeiboAccessToken

  userID

Returns the user ID.

@property (readonly, nonatomic, strong) NSString *userID

Declared In

MLWeiboAccessToken.h

  tokenString

Returns the weibo access token.

@property (readonly, nonatomic, strong) NSString *tokenString

Declared In

MLWeiboAccessToken.h

  expirationDate

Returns the expiration date.

@property (readonly, nonatomic, strong, nullable) NSDate *expirationDate

Declared In

MLWeiboAccessToken.h

  refreshToken

Returns the refresh token.

@property (readonly, nonatomic, strong, nullable) NSString *refreshToken

Declared In

MLWeiboAccessToken.h

– initWithTokenString:userID:expirationDate:refreshToken:

Initializes a new instance.

- (instancetype)initWithTokenString:(NSString *)tokenString userID:(NSString *)userID expirationDate:(nullable NSDate *)expirationDate refreshToken:(nullable NSString *)refreshToken

Parameters

tokenString

The opaque token string.

userID

The user Id.

expirationDate

The optional expiration date (defaults to distantFuture).

refreshToken

The refresh token

Declared In

MLWeiboAccessToken.h

+ currentAccessToken

Returns the “global” weibo access token that represents the currently logged in weibo user.

+ (nullable MLWeiboAccessToken *)currentAccessToken

Declared In

MLWeiboAccessToken.h

+ refreshCurrentAccessToken:

Call [WBHttpRequest requestForRenewAccessTokenWithRefreshToken:queue:withCompletionHandler:] to renew current weibo access token and save the new token to the MaxLeap servers.

+ (void)refreshCurrentAccessToken:(nullable MLBooleanResultBlock)completionHandler

Parameters

completionHandler

an optional callback handler that can surface any errors related to access token refreshing.

Discussion

On a successful refresh, the currentAccessToken will be updated so you typically only need to observe the MLWeiboAccessTokenDidChangeNotification notification.

Declared In

MLWeiboAccessToken.h