DBSDKKeychain

Objective-C

@interface DBSDKKeychain : NSObject

Swift

class DBSDKKeychain : NSObject

Keychain class for storing OAuth tokens.

  • Stores DBAccessToken in the keychain.

    Declaration

    Objective-C

    + (BOOL)storeAccessToken:(nonnull DBAccessToken *)accessToken;

    Swift

    class func store(_ accessToken: DBAccessToken) -> Bool
  • Retrieves a DBAccessToken from the corresponding key (uid) from the keychain.

    Declaration

    Objective-C

    + (nullable DBAccessToken *)retrieveTokenWithUid:(nonnull NSString *)uid;

    Swift

    class func retrieveToken(withUid uid: String) -> DBAccessToken?
  • Retrieves all token uids from the keychain.

    Declaration

    Objective-C

    + (nonnull NSArray<NSString *> *)retrieveAllTokenIds;

    Swift

    class func retrieveAllTokenIds() -> [String]
  • Deletes the stored token value for a key (uid).

    Declaration

    Objective-C

    + (BOOL)deleteTokenWithUid:(nonnull NSString *)uid;

    Swift

    class func deleteToken(withUid uid: String) -> Bool
  • Deletes all key / value pairs in the keychain.

    Declaration

    Objective-C

    + (BOOL)clearAllTokens;

    Swift

    class func clearAllTokens() -> Bool
  • Checks if performing a v1 token migration is necessary, and if so, performs it.

    Declaration

    Objective-C

    + (BOOL)checkAndPerformV1TokenMigration:
                (nonnull DBTokenMigrationResponseBlock)responseBlock
                                      queue:(nullable NSOperationQueue *)queue
                                     appKey:(nonnull NSString *)appKey
                                  appSecret:(nonnull NSString *)appSecret;

    Swift

    class func checkAndPerformV1TokenMigration(_ responseBlock: @escaping DBTokenMigrationResponseBlock, queue: OperationQueue?, appKey: String, appSecret: String) -> Bool