Skip to content

Third-party Platform

This section introduces how to use a third party to log in an account.

Feature Description

objc
#import <QuecUserKit/QuecUserKit.h>
///Initialization.
[QuecUserService sharedInstance]

One-Tap Login

API

Configure QuecOneKeyLoginModel to start one-tap login. All the fields are required.

objc
- (void)oneKeyLoginWithModel:(QuecOneKeyLoginModel *)model
                   success:(QuecVoidBlock)success
                   failure:(QuecErrorBlock)failure;

QuecOneKeyLoginModel Definition

FieldTypeDescription
appidNSStringApply appid on China Mobile Internet Capability Open Platform.
msgidNSStringUUID.
strictcheckNSString0: Do not perform strict check on the server IP whitelist.
1: Perform strict check on the server IP whitelist.
systemtimeNSStringSystem time with format of yyyyMMddHHmmssSSS.
appSecretNSStringApply appSecret on China Mobile Internet Capability Open Platform.
loginTokenNSStringAfter obtaining the permission, the SDK of China Mobile returns a token.
versionNSStringVersion.

Example

objc
QuecOneKeyLoginModel *loginModel = QuecOneKeyLoginModel.new;
loginModel.appid = appid;
loginModel.msgid = uuid;
loginModel.strictcheck = @"0";;
loginModel.systemtime = systemtime;
loginModel.appSecret = appSecret;
loginModel.loginToken = loginToken;
loginModel.version = @"2.0";
[QuecUserService.sharedInstance oneKeyLoginWithModel:loginModel success:^{
    ///Next Action
} failure:^(NSError *error) {
    NSLog(@"check error: %@", error);
}];

Log in with Third Party

API

Log in with the third party.

objc
- (void)loginByAuthCode:(NSString *)authCode success:(QuecVoidBlock)success failure:(QuecErrorBlock)failure;

Parameter

ParameterRequiredDescription
authCodeYAuthorization code.
successNCallback function of successful request.
failureNCallback function of failed request.

Example

objc
[QuecUserService.sharedInstance loginByAuthCode:@"AuthCode" success:^{
    ///Next Action
} failure:^(NSError *error) {
    NSLog(@"check error: %@", error);
}];