MLQQUtils Class Reference

Inherits from NSObject
Declared in MLQQUtils.h

Overview

The MLQQUtils class provides utility functions for using QQ authentication with MLUsers.

Interacting With QQ

+ initializeQQWithAppId:qqDelegate:

Initializes MaxLeap QQ Utils.

+ (void)initializeQQWithAppId:(NSString *)appId qqDelegate:(id<TencentSessionDelegate>)delegate

Parameters

appId

Your qq appId.

delegate

The delegate used to create TencentOAuth instance.

Discussion

Warning: You must invoke this in order to use the QQ functionality in MaxLeap.

Declared In

MLQQUtils.h

+ tencentOAuth

TencentOAuth provides methods for configuring login behavior, default audience and managing QQ Access Token.

+ (TencentOAuth *)tencentOAuth

Return Value

An instance of TencentOAuth that is used by MLQQUtils.

Declared In

MLQQUtils.h

Logging In

+ loginInBackgroundWithPermissions:block:

Asynchronously logs in a user using QQ with read permissions.

+ (void)loginInBackgroundWithPermissions:(NSArray ML_GENERIC ( NSString *) *)permissions block:(nullable MLUserResultBlock)block

Parameters

permissions

Array of read permissions to use.

block

The block to execute when the log in completes. It should have the following signature: ^(MLUser *user, NSError *error).

Discussion

This method delegates to the Tencent Open API SDK to authenticate the user, and then automatically logs in (or creates, in the case where it is a new user) a MLUser.

Declared In

MLQQUtils.h

+ loginInBackgroundWithTencentOAuth:block:

Asynchronously logs in a user using given Facebook Acess Token.

+ (void)loginInBackgroundWithTencentOAuth:(TencentOAuth *)tencentOAuth block:(nullable MLUserResultBlock)block

Parameters

tencentOAuth

An instance of TencentOAuth to use when logging in.

block

The block to execute when the log in completes. It should have the following signature: ^(MLUser *user, NSError *error).

Discussion

This method delegates to the Tencent Open API SDK to authenticate the user, and then automatically logs in (or creates, in the case where it is a new user) a MLUser.

Declared In

MLQQUtils.h

Linking Users

+ linkUserInBackground:withPermissions:block:

Asynchronously links Facebook with read permissions to an existing MLUser.

+ (void)linkUserInBackground:(MLUser *)user withPermissions:(NSArray ML_GENERIC ( NSString *) *)permissions block:(nullable MLBooleanResultBlock)block

Parameters

user

User to link to Facebook.

permissions

Array of read permissions to use.

block

The block to execute when the linking completes. It should have the following signature: ^(BOOL succeeded, NSError *error).

Discussion

This method delegates to the Tencent Open API SDK to authenticate the user, and then automatically links the account to the MLUser. It will also save any unsaved changes that were made to the user.

Declared In

MLQQUtils.h

+ linkUserInBackground:withTencentOAuth:block:

Asynchronously links Facebook Access Token to an existing MLUser.

+ (void)linkUserInBackground:(MLUser *)user withTencentOAuth:(TencentOAuth *)tencentOAuth block:(nullable MLBooleanResultBlock)block

Parameters

user

User to link to Facebook.

tencentOAuth

An instance of TencentOAuth to use.

block

The block to execute when the linking completes. It should have the following signature: ^(BOOL succeeded, NSError *error).

Discussion

This method delegates to the Tencent Open API SDK to authenticate the user, and then automatically links the account to the MLUser. It will also save any unsaved changes that were made to the user.

Declared In

MLQQUtils.h

+ unlinkUserInBackground:block:

Unlinks the MLUser from a Facebook account asynchronously.

+ (void)unlinkUserInBackground:(MLUser *)user block:(nullable MLBooleanResultBlock)block

Parameters

user

User to unlink from Facebook.

block

The block to execute. It should have the following argument signature: ^(BOOL succeeded, NSError *error).

Declared In

MLQQUtils.h

Getting Linked State

+ isLinkedWithUser:

Whether the user has their account linked to Facebook.

+ (BOOL)isLinkedWithUser:(nullable MLUser *)user

Parameters

user

User to check for a facebook link. The user must be logged in on this device.

Return Value

YES if the user has their account linked to Facebook, otherwise NO.

Declared In

MLQQUtils.h