STSSDKAuthManager

@interface STSSDKAuthManager : NSObject

StraaS.io auth manager.

  • The account id of current vendor.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull accountId;

    Swift

    var accountId: String { get }
  • The app token. If the app is authorized, then the token is not nil.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull token;

    Swift

    var token: String { get }
  • Using new to create a STSSDKAuthManager instance is unavailable.

    Declaration

    Objective-C

    + (nonnull instancetype)new;
  • Using init to create a STSSDKAuthManager instance is unavailable.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Returns the STSSDKAuthManager instance, creating it if it doesn’t exist yet.

    Declaration

    Objective-C

    + (nonnull STSSDKAuthManager *)sharedManager;

    Swift

    class func shared() -> STSSDKAuthManager

    Return Value

    The shared instance of STSSDKAuthManager.

  • Refresh a member access token.

    Declaration

    Objective-C

    - (nonnull NSURLSessionDataTask *)
        refreshMemberToken:(nonnull NSString *)refreshToken
                   success:(nonnull void (^)(NSString *_Nonnull))success
                   failure:(nonnull void (^)(NSError *_Nonnull))failure;

    Swift

    func refreshMemberToken(_ refreshToken: String, success: @escaping (String) -> Void, failure: @escaping (Error) -> Void) -> URLSessionDataTask

    Parameters

    refreshToken

    The token wants to be refresh

    success

    Handler for successful request. It takes refreshed token argument.

    failure

    Error handler.

    Return Value

    The new session data task. Returns nil if the application is unauthorized.