supersdk

文档中心

文档中心

下载文档

GtaSDK Access Document

Get the account information of the currently logged in user

Interface description: Obtain whether the user account is bound or not and the token value. Choose whether a mask is required. If YES, there will be a loading box on the interface when calling the interface, and the loading box will not disappear until it is successfully obtained or failed.

Call example:

NSDictionary *parameters =@{
                                         @"isMask":@(YES)// Whether to add loading box prompt, NO means no loading box prompt
                                        };
[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"accountInfo" parameters:parameters];

Interface callback:

+ (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result
{
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** received callback\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    
    
    // 1.Callback parameter analysis
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    
    int code            = [[retParam objectForKey:@"code"] intValue];   // status code
    NSString *msg       = [retParam objectForKey:@"msg"];               // description
    
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {// platform module callback
        
        if ([funcName isEqualToString:@"accountInfo"]) {// get account information callback of current login user
           if (code==BCORE_SUCCESS) {
                NSDictionary *accountInfo = [retParam objectForKey:@"data"];
                NSLog(@"obtain user account information successful, account information is:%@", accountInfo);
            }
            else {
                NSLog(@"obtain user account information failed:%@", desc);
            }  
        }
    }
}

Callback log printing

2017-11-10 16:02:13.029894+0800 youzuGTA[21539:5052325] ****** received callback
 moduleName : platform,
 funcName : accountInfo,
 parameters : {
  "msg" : "账号信息获取成功",
  "data" : "{\"gta\":1,\"facebook\":0,\"twitter\":0,\"google\":0,\"livespace\":0,\"yahoo\":0,\"gamecenter\":1,\"token\":\"7161efebaf156099ca71ec141823b7d8\"}",
  "code" : 1
}

Account binding page pops up

Interface description: jump to different binding interfaces according to the corresponding value of bindType. The binding types are GTA, Facebook, Twitter and GameCenter.

Call example:

NSDictionary *parameters =@{
                                          @"bindType":@"GTA"// * bindType value is GTA、Facebook、Twitter、GameCenter
                                        };
[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"showAccountLinkJson" parameters:parameters];

Interface callback:

+ (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result
{
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** received callback\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    
    
    // 1.Callback parameter analysis
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    
    int code            = [[retParam objectForKey:@"code"] intValue];   // status code
    NSString *msg       = [retParam objectForKey:@"msg"];               // description
    
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {// platform module callback
        
        if ([funcName isEqualToString:@"showAccountLinkJson"]) {// account binding callback
           if (code ==BCORE_SUCCESS) {
                NSString *accountType = [retParam objectForKey:@"data"];
                NSLog(@"binding account number succeeded. type of bound account number is:%@", accountType);
            }
            else {
                NSLog(@"failed to bind, reason is:%@", desc);
            }
        }
    }
}

Callback log printing:

2017-11-10 16:04:20.862821+0800 youzuGTA[21539:5052325] ****** received callback
 moduleName : platform,
 funcName : showAccountLinkJson,
 parameters : {
  "msg" : "successfully bound",
  "data" : "GTA",
  "code" : 1
}

Obtain Facebook ID of Facebook login

Interface description: Get the user ID number of a user in facebook.

Call example:

[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"getfbid" parameters:nil];

Interface callback:

+ (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result
{
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** received callback\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    
    
    // 1.Callback parameter analysis
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    
    int code            = [[retParam objectForKey:@"code"] intValue];   // status code
    NSString *msg       = [retParam objectForKey:@"msg"];               // description
    
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {// platform module callback
        
        if ([funcName isEqualToString:@"getfbid"]) {// Obtain facebook ID callback for Facebook login
           if (code==BCORE_SUCCESS) {
                NSString * facebookID = [retParam objectForKey:@"data"];
                NSLog(@"successfully obtained facebookID,facebookID is:%@", facebookID);
            }
            else {
                NSLog(@"failed to obtain facebook ID, reason is:%@", desc);
            }
        }
    }
}

Callback log printing:

2017-11-10 16:05:05.316041+0800 youzuGTA[21539:5052325] ****** received callback
 moduleName : platform,
 funcName : getfbid,
 parameters : {
  "msg" : "successfully obtained facebookID",
  "data" : "305129846360359",
  "code" : 1
}

Check whether the user has a bound email, and return the email

Interface description: Check whether email is bound.

Call example:

[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"queryBindEmail" parameters:nil];

Interface callback:

+ (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result
{
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** received callback\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    
    
    // 1.Callback parameter analysis
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    
    int code            = [[retParam objectForKey:@"code"] intValue];   // status code
    NSString *msg       = [retParam objectForKey:@"msg"];               // description
    
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {// platform module callback
        
        if ([funcName isEqualToString:@"queryBindEmail"]) {// check whether email is bound or not
           if (code==BCORE_SUCCESS) {
                NSString *email = [retParam objectForKey:@"data"];
                NSLog(@"account is bound, email is:%@", email);
            }
            else {
                NSLog(@"account is not bound to email");
            }
        }
    }
}

Callback log printing:

2017-11-10 16:05:22.935072+0800 youzuGTA[21539:5052325] ****** received callback
 moduleName : platform,
 funcName : queryBindEmail,
 parameters : {
  "msg" : "account already bound to email",
  "data" : "1003265311@qq.com",
  "code" : 1
}

Open the bound email page

Interface description: open bound email page.

Call example:

[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"showBindEmail" parameters:nil];

Interface callback:

+ (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result
{
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** received callback\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    
    
    // 1.Callback parameter analysis
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    
    int code            = [[retParam objectForKey:@"code"] intValue];   // status code
    NSString *msg       = [retParam objectForKey:@"msg"];               // description
    
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {// platform module callback
        
        if ([funcName isEqualToString:@"showBindEmail"]) {// open bound email page callback
           if (code==BCORE_SUCCESS) {
                NSString *email = [retParam objectForKey:@"data"];
                SLog(@"successfully bound to mailbox:%@", email);
            }
            else {
                NSLog(@"not bound, reason is %@", desc);
            }
        }
    }
}

Callback log printing:

2017-11-10 16:05:22.935072+0800 youzuGTA[21539:5052325] ****** received callback
 moduleName : platform,
 funcName : showBindEmail,
 parameters : {
  "msg" : "bound mailbox successfully,
  "data" : "1003265311@qq.com",
  "code" : 1
}

Game custom settings SDK language

Interface description: Pass in GTA language parameters to change GTA language and GTA customer service language

Supports the following languages:
English:en  Traditional Chinese:zh Simplified Chinese:zh_cn French:fr German:de Spanish:es Polish:pl Portuguese:pt Turkish:tr Russian:ru    Arabic:ar Korean ko Japanese:ja Thai:th、Indonesian:id、Italian:it

Call example:


NSDictionary *parameters = @{
       @"languagePath" : @"ko"  // Language parameters
      };
  [SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"setLanguagePath" parameters:parameters];
// Special interface set language method
        NSDictionary *param = @{
                @"languagePath" : @"ko",
       };
        [SuperSDK  invoke:BCORE_MODULE_PLATFORM funcName:BCORE_FUNC_OTHER_FUNCTION parameters:@{
         BCORE_KEY_OTHER_FUNC_NAME : @"languagePath",
         BCORE_KEY_OTHER_FUNC_PARAMS : param
        }];

Client single login

Note: The SuperSDK.framework in the parent package needs to be updated to the latest version

Interface invoke:

[SuperSDK invoke:BCORE_MODULE_PLATFORM  funcName:@"GuestSingleLogin"  parameters:nil];

Interface callback:

- (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result {
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** callback received\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    // 1.Analysis of callback parameters
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    int code            = [[retParam objectForKey:@"code"] intValue];   
    NSString *msg       = [retParam objectForKey:@"msg"];               
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {
        if ([funcName isEqualToString:@"GuestSingleLogin"]) {
            if (code == BCORE_SUCCESS) {
                //If the visitor's single login is successful, you need to take the osdk_ticket to the game server for verification to determine the legitimacy of the user information
                NSDictionary *data  = [retParam objectForKey:@"data"]; 
                NSString *ticket = [data objectForKey:@"osdk_ticket"];//Get the ticket and go to the game server for login verification
            } 
            else {
                NSLog(@"Guest login failed,code=%d ,The reason is %@",code, msg);
            }
        }
    }
}

Callback log printing:

2022-12-15 15:09:46.457637+0800 Demo_Mubao[1209:349856] ****** callback received
moduleName : platform,
funcName : GuestSingleLogin,
result : {
            "msg":"login success",
            "data":{
                     "status":1,
                     "msg":"login success",
                     "osdk_ticket":"eyJvc2RrX2dhbWVfaWQiOiIxOTYzNzgwNzIiLCJ1c2VyX2lkIjoiMTY2NjkzOTc4MTY5NDQ2NjQ4NTY5ODU0MCIsImxvZ2luX3Nka19uYW1lIjoiZ3RhcmNhZGUiLCJjaGFubmVsX2lkIjoiMCIsImV4dGVuZCI6IjIxNDd8MjAxODQwMHwxODQ5IiwiYWNjb3VudF9zeXN0ZW1faWQiOiIwMDYwMDE1Iiwib3Nka191c2VyX2lkIjoiMDA2MDAxNV8xNjY2OTM5NzgxNjk0NDY2NDg1Njk4NTQwIiwiaXAiOiI0NS40MC42MC4yMTciLCJjb3VudHJ5IjoiMDAiLCJ0aW1lIjoxNjY5Njg4NjYxLCJzaWduIjoiYmM3NTBiY2U4YjkwODhkYTc2M2ViZGYzNmNhZjY4YjYifQ==",
                     "userinfo":{
                                  "user_id":"1666939781694466485698540",
                                  "login_sdk_name":"gtarcade"
                                }
                    },
            "code":1
         }

Determine whether the currently logged in account is a client

[SuperSDK invokeBool:BCORE_MODULE_PLATFORM funcName:BCORE_FUNC_HAS_GUEST parameters:nil]

Client upgrade

[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:BCORE_FUNC_GUEST_UPGRADE parameters:nil];

Third party login call

  • GTA call instance:

    NSDictionary *parameters =@{ BCORE_KEY_OTHER_FUNC_NAME : @"GTALogin"};
    [SuperSDK invoke:BCORE_MODULE_PLATFORM   funcName: BCORE_FUNC_OTHER_FUNCTION  parameters:parameters];
    
  • Facebook call instance:

    NSDictionary *parameters =@{ BCORE_KEY_OTHER_FUNC_NAME : @"FacebookLogin"};
    [SuperSDK invoke:BCORE_MODULE_PLATFORM   funcName: BCORE_FUNC_OTHER_FUNCTION  parameters:parameters];
    
  • GameCenter call instance:

    NSDictionary *parameters =@{ BCORE_KEY_OTHER_FUNC_NAME : @"GameCenterLogin"};
    [SuperSDK invoke:BCORE_MODULE_PLATFORM   funcName: BCORE_FUNC_OTHER_FUNCTION  parameters:parameters];
    
  • Twitter call instance:

    NSDictionary *parameters =@{ BCORE_KEY_OTHER_FUNC_NAME : @"TwitterLogin"};
    [SuperSDK invoke:BCORE_MODULE_PLATFORM   funcName: BCORE_FUNC_OTHER_FUNCTION  parameters:parameters];
    
  • Apple call instance:

    NSDictionary *parameters =@{ BCORE_KEY_OTHER_FUNC_NAME : @"AppleLogin"};
    [SuperSDK invoke:BCORE_MODULE_PLATFORM   funcName: BCORE_FUNC_OTHER_FUNCTION  parameters:parameters];
    

Get product information

Interface description: Pass in the real commodity id to get the currency type and other parameters.

Call example:

//Note: To obtain the product information of ordinary products, use "|" to separate multiple product ids
NSDictionary *parameters = @{
       @"products" : @"pid1|pid2|pid3..." 
      };
      
//Note: To obtain the product information of the subscription product, use "|" to separate multiple product ids
NSDictionary *parameters = @{
       @"productsSubs" : @"pid1|pid2|pid3..." 
      };
      
//Note: Get product information for regular and subscription products
NSDictionary *parameters = @{
       @"products" : @"pid1|pid2|pid3...",
       @"productsSubs" : @"pid1|pid2|pid3..."
      };      
      
[SuperSDK invoke:BCORE_MODULE_PLATFORM funcName:@"getProductsInfoJson" parameters:parameters];

Callback example:

+ (void)handlerCallback:(NSString *)moduleName funcName:(NSString *)funcName result:(NSString *)result
{
    // Handle SuperSDK callback logic, note that all module callbacks are here.
    NSLog(@"****** received callback\n moduleName : %@,\n funcName : %@,\n result : %@", moduleName, funcName, result);
    
    
    // 1.Callback parameter analysis
    NSDictionary *retParam = nil;
    if (result) {
        NSData *jsonData = [result dataUsingEncoding:NSUTF8StringEncoding];
        if (jsonData) {
            retParam = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
        }
    }
    
    int code            = [[retParam objectForKey:@"code"] intValue];   // status code
    NSString *msg       = [retParam objectForKey:@"msg"];               // description
    
    // 2.Callback parameter judgment
    if ([moduleName isEqualToString:BCORE_MODULE_PLATFORM]) {// platform module callback
        
       if ([funcName isEqualToString:@"getProductsInfoJson"]) {// Obtain product information
         if (code==BCORE_SUCCESS) {
             NSArray *productsInfo = [retParam objectForKey:@"data"];
             NSLog(@"successfully obtained product information:%@", productsInfo);
          }
          else {
              NSLog(@"failed to obtain product information:%@", desc);
          }
       }
    }
}

Callback log printing

2017-11-10 16:01:46.950422+0800 youzuGTA[21539:5052325] ****** received callback
 moduleName : platform,
 funcName : getProductsInfoJson,
 parameters : {
  "desc" : "successfully obtained product information",
  "data" : [
    {
      "price_currency_code" : "CNY",
      "productId" : "com.uuzu.zctx1",
      "price" : "¥6",
      "title" : "currency",
      "country_code" : "CN",
      "description" : "currency, used to buy game items",
      "language_code" : "zh"
    },
    {
      "price_currency_code" : "CNY",
      "productId" : "com.uuzu.zctx3",
      "price" : "¥12",
      "title" : "currency",
      "country_code" : "CN",
      "description" : "in-game, used to purchase virtual items",
      "language_code" : "zh"
    }
  ],
  "code" : 1
}