TCGBGamebase Class Reference
Inherits from | NSObject |
---|---|
Declared in | TCGBGamebase.h |
Initialization
+ initializeWithConfiguration:completion:
This method initialize TCGBGamebase with TCGBConfiguration instance. InitializeCompletion return launching datas when TCGBGamebase has initialized and has completed getting launching informations from server.
+ (void)initializeWithConfiguration:(TCGBConfiguration *)configuration completion:(InitializeCompletion)completion
Parameters
configuration |
A parameter that were set appId, appVersion, zoneType and etc. |
---|---|
completion |
A completion that is called after initializing TCGBGamebase completed. |
Discussion
You must call this method first, after the app has launched.
Usage Example
- (void)onButtonInitialize {
[TCGBGamebase setDebugMode:YES];
TCGBConfiguration* config = [TCGBConfiguration configurationWithAppID:@"your app(project) ID" appVersion:@"your app version"];
[TCGBGamebase initializeWithConfiguration:config completion:^(LaunchingInfo launchingData, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"TCGBGamebase initialization is succeeded");
// Check status of you app.
// If status of app is maintenance or terminated service or etc, you must blocking UI and you should make user cannot log in your service.
// You can use [TCGBLaunching launchingStatus] method to check status of your app.
}
else {
NSLog(@"TCGBGamebase initialization is failed with error:[%@]", [error description]);
}
}];
}
Declared In
TCGBGamebase.h
+ initializeWithConfiguration:launchOptions:completion:
This method initialize TCGBGamebase with TCGBConfiguration instance. InitializeCompletion return launching datas when TCGBGamebase has initialized and has completed getting launching informations from server.
+ (void)initializeWithConfiguration:(TCGBConfiguration *)configuration launchOptions:(NSDictionary *)launchOptions completion:(InitializeCompletion)completion
Parameters
configuration |
A parameter that were set appId, appVersion, zoneType and etc. |
---|---|
launchOptions |
An extra launch options when application needs to be customized initialization. |
completion |
A completion that is called after initializing TCGBGamebase completed. |
Discussion
You must call this method first, after the app has launched.
Declared In
TCGBGamebase.h
Environment Setting & Getting
+ setDebugMode:
Method that setting TCGBGamebase to debug mode. Debug mode can print logs that has debug, info and verbose log level on console app.
+ (void)setDebugMode:(BOOL)debugMode
Parameters
debugMode |
Boolean value that whether use debug mode or not. |
---|
Discussion
You should call this method before calling initializeWithConfiguration:launchOptions:completion: method.
Usage Example
- (void)onButtonInitialize {
[TCGBGamebase setDebugMode:YES];
TCGBConfiguration* config = [TCGBConfiguration configurationWithAppID:@"your app(project) ID" appVersion:@"your app version"];
[TCGBGamebase initializeWithConfiguration:config completion:^(LaunchingInfo launchingData, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"TCGBGamebase initialization is succeeded");
// Check status of you app.
// If status of app is maintenance or terminated service or etc, you must blocking UI and you should make user cannot log in your service.
// You can use [TCGBLaunching launchingStatus] method to check status of your app.
}
else {
NSLog(@"TCGBGamebase initialization is failed with error:[%@]", [error description]);
}
}];
}
See Also
Declared In
TCGBGamebase.h
+ isDebugMode
Method that got boolean value whether current SDK is running with debug mode or not.
+ (BOOL)isDebugMode
Return Value
Boolean value that current SDK is running with debug mode or not.
Discussion
Usage Example
-(void)onButtonIsDebugMode {
BOOL isDebugMode = [TCGBGamebase isDebugMode];
NSLog(@"Debug Mode is %@", isDebugMode ? @"on":@"off");
}
See Also
Declared In
TCGBGamebase.h
+ SDKVersion
Method that got SDK version of client
+ (NSString *)SDKVersion
Return Value
String value that got client sdk version.
Discussion
Usage Example
- (void)onButtonGetSDKVersion {
NSString* version = [TCGBGamebase SDKVersion];
NSLog(@"Client SDK Version = %@", version];
}
Declared In
TCGBGamebase.h
+ appID
Method that got ‘Projet ID (app ID)’ is set by initialize TCGBGamebase.
+ (NSString *)appID
Return Value
String value that got app id (project id).
Discussion
‘Project ID (app ID)’ is indicated on Toast Cloud Console Project List Page.
Usage Example
- (void)onButtonGeTCGBPID {
NSString* appID = [TCGBGamebase appID];
NSLog(@"App ID = %@", appID);
}
Declared In
TCGBGamebase.h
+ userID
Method that got an UserID that identify each user in Platform.
+ (NSString *)userID
Return Value
String value that got userID.
Discussion
You can get this after login has succeeded.
Usage Example
- (void)onButtonGetUserID {
NSString* userID = [TCGBGamebase userID];
NSLog(@"User ID = %@", userID];
}
Declared In
TCGBGamebase.h
+ accessToken
Method that got an access token is taken from TCGB Platform server.
+ (NSString *)accessToken
Return Value
String value that got TCGB Access Token.
Discussion
You can get htis after login has succeeded. This value will be removed by logout, withdrawal and will be expired 15 day after last logged in.
Usage Example
- (void)onButtonAccessToken {
NSString* TCGBAccessToken = [TCGBGamebase accessToken];
NSLog(@"User ID = %@", TCGBAccessToken];
}
Declared In
TCGBGamebase.h
+ isSandbox
Return whether this project is sandbox mode or not.
+ (BOOL)isSandbox
Return Value
Boolean value whether this project is sandbox mode.
Declared In
TCGBGamebase.h
+ isSuccessWithError:
Method that distinguished the error object is whether succeeded or failed.
+ (BOOL)isSuccessWithError:(TCGBError *)error
Parameters
error |
Object for TCGBError class what distinguished is whether succeeded or not. |
---|
Return Value
Boolean value that the TCGBError object is whether succeeded of failed.
Discussion
Usage Example
- (void)onButtonSuccessOfFail {
[TCGBGamebase logoutWithCompletion:^(TCGBError *error) {
BOOL isSuccess = [TCGBGamebase isSuccessWithError:error];
if (isSuccess) {
NSLog(@"logout is Success");
}
else {
NSLog(@"logout is Fail");
}
}
}
Declared In
TCGBGamebase.h
System Language & Country
+ deviceLanguageCode
Get Language Code from device settings.
+ (NSString *)deviceLanguageCode
Return Value
language code from settings.
Availability
Added 1.14.0.
Declared In
TCGBGamebase.h
+ countryCode
Get country code from USIM or device locale.
+ (NSString *)countryCode
Declared In
TCGBGamebase.h
+ countryCodeOfUSIM
Get country code from USIM.
+ (NSString *)countryCodeOfUSIM
Declared In
TCGBGamebase.h
+ countryCodeOfDevice
Get country code from device locale.
+ (NSString *)countryCodeOfDevice
Declared In
TCGBGamebase.h
Display Language
+ setDisplayLanguageCode:
Set Display Language Code when initializing Gamebase SDK.
+ (void)setDisplayLanguageCode:(NSString *)languageCode
Parameters
languageCode |
It represent language code (ISO-639) |
---|
Declared In
TCGBGamebase.h
+ displayLanguageCode
Method that returns displayLanguage that you have set.
+ (NSString *)displayLanguageCode
Return Value
String value of language code (ISO-639)
Declared In
TCGBGamebase.h
Login API
+ loginWithType:viewController:completion:
Try to login with type of ID Provider. If after succeeded, completion returns TCGB Auth informations include authToken, userID.
+ (void)loginWithType:(NSString *)type viewController:(UIViewController *)viewController completion:(LoginCompletion)completion
Parameters
type |
String value of IDPType name (guest, facebook, payco, iosgamecenter). |
---|---|
viewController |
UIViewController object that present login view controller. |
completion |
callback that returned whether login success or fail and return TCGBAuthToken. |
Discussion
TCGBGamebase has loginForLastLoggedInProviderWithCompletion method known as Auto-Login. So before you try to login, you should try to login with loginForLastLoggedInProviderWithCompletion: method. If it is failed, you can try to login with loginWithType:viewController:completion: method
Usage Example
- (void)onButtonLogin {
NSString* idpType = @"facebook";
UIViewController* topViewController = nil;
[TCGBGamebase loginForLastLoggedInProviderWithCompletion:^(TCGBAuthToken *authToken, TCGBError *error){
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"Login is succeeded.");
}
else {
if (error.code == TCGB_ERROR_SOCKET_ERROR || error.code == TCGB_ERROR_RESPONSE_TIMEOUT) {
NSLog(@"Retry loginForLastLoggedInProviderWithCompletion: or Notify to user -\n\terror[%@]", [error description]);
}
else {
NSLog(@"Try to login with loginWithType:viewController:completion:");
[TCGBGamebase loginWithType:idpType viewController:topViewController completion:^(TCGBAuthToken *authToken, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"Login is succeeded.");
}
else {
NSLog(@"Login is failed.");
}
}];
}
}
}];
}
Declared In
TCGBGamebase.h
+ loginWithCredential:viewController:completion:
Try to login with credential information received from External SDK or OAuth.
+ (void)loginWithCredential:(NSDictionary *)credentialInfo viewController:(UIViewController *)viewcontroller completion:(LoginCompletion)completion
Parameters
credentialInfo |
NSDictionary value that contains provider_name (guest, faceboo, payco, iosgamecenter), access_token of IDP, access_token_secret of IDP that receive from IDP SDK. |
---|---|
viewcontroller |
UIViewController object that present login view controller. |
completion |
callback that returned whether login is success or fail and return TCGBAuthToken. |
Discussion
Usage Example
- (void)onButtonLogin {
UIViewController* topViewController = nil;
NSString* facebookAccessToken = @"feijla;feij;fdklvda;hfihsdfeuipivaipef/131fcusp";
NSMutableDictionary* credentialInfo = [NSMutableDictionary dictionary];
credentialInfo[@"provider_name"] = @"facebook";
credentialInfo[@"access_token"] = facebookAccessToken;
[TCGBGamebase loginWithCredential:credentialInfo viewController:topViewController completion:^(TCGBAuthToken *authToken, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"Login is succeeded.");
}
else {
if (error.code == TCGB_ERROR_SOCKET_ERROR || error.code == TCGB_ERROR_RESPONSE_TIMEOUT) {
NSLog(@"Retry loginForLastLoggedInProviderWithCompletion: or Notify to user -\n\terror[%@]", [error description]);
}
else {
NSLog(@"Try to login with loginWithType:viewController:completion:");
[TCGBGamebase loginWithType:idpType viewController:topViewController completion:^(TCGBAuthToken *authToken, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"Login is succeeded.");
}
else {
NSLog(@"Login is failed.");
}
}];
}
}
}];
Declared In
TCGBGamebase.h
+ loginForLastLoggedInProviderWithViewController:completion:
Try to login for last logged in ID Provider. This method use local stored name of last logged in IDP.
+ (void)loginForLastLoggedInProviderWithViewController:(UIViewController *)viewController completion:(LoginCompletion)completion
Parameters
completion |
callback that return whether login success or fail and return TCGBAuthToken |
---|
Discussion
This method try to login with local stored TCGBAuthToken.
Usage Example
- (void)onButtonLogin {
NSString* idpType = @"facebook";
UIViewController* topViewController;
[TCGBGamebase loginForLastLoggedInProviderWithViewController:topViewController completion:^(TCGBAuthToken *authToken, TCGBError *error){
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"Login is succeeded.");
}
else {
if (error.code == TCGB_ERROR_SOCKET_ERROR || error.code == TCGB_ERROR_RESPONSE_TIMEOUT) {
NSLog(@"Retry loginForLastLoggedInProviderWithCompletion: or Notify to user -\n\terror[%@]", [error description]);
}
else {
NSLog(@"Try to login with loginWithType:viewController:completion:");
[TCGBGamebase loginWithType:idpType viewController:topViewController completion:^(TCGBAuthToken *authToken, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"Login is succeeded.");
}
else {
NSLog(@"Login is failed.");
}
}];
}
}
}];
}
Declared In
TCGBGamebase.h
Mapping API
+ addMappingWithType:viewController:completion:
If you have logged in with an IDP Type. You can map with the other ID Providers, excluding Logged in IDP type.
+ (void)addMappingWithType:(NSString *)type viewController:(UIViewController *)viewController completion:(LoginCompletion)completion
Parameters
type |
String value of IDPType name (guest, facebook, payco, iosgamecenter). |
---|---|
viewController |
UIViewController object that present login view controller. |
completion |
callback that return whether addMapping is success or fail and return TCGBAuthToken. If you received TCGB_ERROR_AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER or TCGB_ERROR_AUTH_ADD_MAPPING_ALREADY_HAS_SAME_IDP error, A TCGBAuthToken received from completion is not for current userID, but for already mapped account. |
Discussion
Mapping IDPs are just mapped to TCGB UserID. ID Provider type what mapped to UserID only can be removed from mapped UserID.
Warning: Warning: Logged in ID Provider type cannot be removed from UserID.
Warning: Warning: You can call addMapping after logged in.
Usage Example
- (void)onButtonAddMapping {
NSString* idpType = @"facebook";
[TCGBGamebase addMappingWithType:idpType viewController:nil completion:^(TCGBAuthToken *authToken, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"addMapping is succeeded.");
}
else {
NSLog(@"addMapping is failed with Error:[%@]", [error description]);
if (error.code == TCGB_ERROR_AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER || error.code == TCGB_ERROR_AUTH_ADD_MAPPING_ALREADY_HAS_SAME_IDP) {
NSLog(@"This ID Provider type has mapped to the other UserID");
}
else {
NSLog(@"addMapping is failed with error:[%@]", [error description]);
}
}
}];
}
Declared In
TCGBGamebase.h
+ addMappingWithCredential:viewController:completion:
Try to addMapping with credential information received from External SDK or OAuth.
+ (void)addMappingWithCredential:(NSDictionary *)credentialInfo viewController:(UIViewController *)viewcontroller completion:(LoginCompletion)completion
Parameters
credentialInfo |
NSDictionary value that contains provider_name (guest, faceboo, payco, iosgamecenter), access_token of IDP, access_token_secret of IDP that receive from IDP SDK. |
---|---|
viewcontroller |
UIViewController object that present login view controller. |
completion |
callback that returned whether addMapping is success or fail and return TCGBAuthToken. |
Discussion
Usage Example
- (void)onButtonAddMapping {
UIViewController* topViewController = nil;
NSString* facebookAccessToken = @"feijla;feij;fdklvda;hfihsdfeuipivaipef/131fcusp"; // Get access token of your provider using provider SDK.
NSMutableDictionary* credentialInfo = [NSMutableDictionary dictionary];
credentialInfo[kTCGBAuthLoginWithCredentialProviderNameKeyname] = @"facebook";
credentialInfo[kTCGBAuthLoginWithCredentialAccessTokenKeyname] = facebookAccessToken;
[TCGBGamebase addMappingWithCredential:credentialInfo viewController:topViewController completion:^(TCGBAuthToken *authToken, TCGBError *error) {
if ([TCGBGamebase isSuccessWithError:error] == YES) {
NSLog(@"AddMapping is succeeded.");
}
else if (error.code == TCGB_ERROR_SOCKET_ERROR || error.code == TCGB_ERROR_RESPONSE_TIMEOUT) {
NSLog(@"Retry addMapping")
}
else if (error.code == TCGB_ERROR_AUTH_ADD_MAPPING_ALREADY_MAPPED_TO_OTHER_MEMBER) {
NSLog(@"Already mepped to other member");
}
else {
NSLog(@"AddMapping Error - %@", [error description]);
}
}];
}
Declared In
TCGBGamebase.h
+ removeMappingWithType:viewController:completion:
Disconnect ID Provider from UserID.
+ (void)removeMappingWithType:(NSString *)type viewController:(UIViewController *)viewController completion:(RemoveMappingCompletion)completion
Parameters
type |
String value of IDPType name (guest, facebook, payco, iosgamecenter). |
---|---|
completion |
callback that return whether removeMapping is success or fail. |
Discussion
Warning: Warning: You cannot remove mapping last logged in ID Provider.
Usage Example
- (void)onButtonRemoveMapping {
NSString* idpType = @"facebook";
[TCGBGamebase removeMappingWithType:idpType viewController:topViewController completion:^(TCGBError *error) {
NSLog(@"removeMappingWityType:%@ is %@", idpType, [TCGBGamebase isSuccessWithError:error] == YES ? @"success":@"fail");
}];
}
Declared In
TCGBGamebase.h
Logout API
+ logoutWithViewController:completion:
This method make user logout from TCGB Game Platform.
+ (void)logoutWithViewController:(UIViewController *)viewController completion:(LogoutCompletion)completion
Parameters
completion |
callback that return whether logout is success or fail |
---|
Discussion
This method try to logout from ID Provider SDK.
Usage Example
- (void)onButtonWithdrawal {
[TCGBGamebase logoutWithViewController:topViewController completion:^(TCGBError *error) {
NSLog(@"You have withdrew from TCGBGamebase : %@, [error debugDescription]);
}];
}
Declared In
TCGBGamebase.h
Withdrawal API
+ withdrawWithViewController:completion:
This method make user withdraw from TCGB Game Platform, but IDPs need to be unlink in each IDP user preference page.
+ (void)withdrawWithViewController:(UIViewController *)viewController completion:(WithdrawCompletion)completion
Parameters
completion |
callback that return whether withdrawal is success or fail |
---|
Discussion
This method cannot drop out of IDP.
Usage Example
- (void)onButtonWithdrawal {
[TCGBGamebase withdrawWithViewController:topViewController completion:^(TCGBError *error) {
NSLog(@"You have withdrew from TCGBGamebase : %@, [error debugDescription]);
}];
}
Declared In
TCGBGamebase.h
Login Information
+ lastLoggedInProvider
Method that return which IDP have been logged in at last time.
+ (NSString *)lastLoggedInProvider
Return Value
An String that has name of IDPs.
Discussion
Usage Example
- (void)onButtonGettingLastLoggedinProvider {
NSString* lastProvider = [TCGBGamebase lastLoggedInProvider];
NSLog(@"lastLoggedInProvider returns %@", lastProvider];
}
Declared In
TCGBGamebase.h
+ authMappingList
Method that returns which IDPs have been mapped to current UserID.
+ (NSArray *)authMappingList
Return Value
An Array that has name of IDPs.
Discussion
Usage Example
- (void)onButtonGettingMappedAuthList {
NSArray* authList = [TCGBGamebase authMappingList];
NSLog(@"authMappingList returns %@", [authList description]);
}
Declared In
TCGBGamebase.h
ID Provider Information
+ authProviderUserIDWithIDPCode:
Method that return UserID of ID Provider such as ‘facebook’, ‘payco’, ‘iosgamecenter’ and etc.
+ (NSString *)authProviderUserIDWithIDPCode:(NSString *)IDPCode
Parameters
IDPCode |
IDPCode string value that you want to get. |
---|
Return Value
A String value of user ID.
Discussion
Usage Example
- (void)onButtonGettingIDPUserName {
NSString* userID = [TCGBGamebase authProviderUserIDWithIDPCode:@"facebook"];
NSLog(@"authProvider UserID = %@", userID);
}
Declared In
TCGBGamebase.h
+ authProviderAccessTokenWithIDPCode:
Method that return AccessToken of ID Provider such as ‘facebook’, ‘payco’, ‘iosgamecenter’ and etc.
+ (NSString *)authProviderAccessTokenWithIDPCode:(NSString *)IDPCode
Parameters
IDPCode |
IDPCode string value that you want to get. |
---|
Return Value
A String value of AccessToken.
Discussion
Usage Example
- (void)onButtonGettingIDPAccessToken {
NSString* accessToken = [TCGBGamebase authProviderAccessTokenWithIDPCode:@"facebook"];
NSLog(@"authProvider AccessToken = %@", accessToken);
}
Declared In
TCGBGamebase.h
+ authProviderProfileWithIDPCode:
Method that return Profile Information of ID Provider such as ‘facebook’, ‘payco’, ‘iosgamecenter’ and etc.
+ (TCGBAuthProviderProfile *)authProviderProfileWithIDPCode:(NSString *)IDPCode
Parameters
IDPCode |
IDPCode string value that you want to get. |
---|
Return Value
A String value of profile.
Discussion
Usage Example
- (void)onButtonGettingIDPProfile { NSString* profile = [TCGBGamebase authProviderProfileWithIDPCode:@“facebook”]; NSLog(@“authProvider profile = %@”, profile); }
Declared In
TCGBGamebase.h
+ banInfo
Method that return ban information of login response.
+ (TCGBBanInfo *)banInfo
Return Value
A ban infomation of login respons.
Discussion
Usage Example
- (void)onButtonGettingIDPProfile { TCGBBanInfo* banInfo = [TCGBGamebase banInfo]; NSLog(@“BanInfo = %@”, [banInfo debugDescription]); }
Declared In
TCGBGamebase.h
+ addServerPushEvent:
Method that add an event handler to receive server push from Gamebase Server.
+ (void)addServerPushEvent:(void ( ^ ) ( TCGBServerPushMessage *))handler
Availability
Added 1.8.0.
Discussion
Usage Example
- (void)addServerPushEventHandler { void(^pushHandler)(TCGBServerPushMessage ) = ^(TCGBServerPushMessage message) { NSString* msg = [NSString stringWithFormat:@“[Sample] receive server push =>\ntype: %@\ndata: %@”, message.type, message.data]; [self printLogAndShowAlertWithData:msg error:nil alertTitle:@“server push”]; }; [TCGBGamebase addServerPushEvent:pushHandler]; }
Declared In
TCGBGamebase.h
+ removeServerPushEvent:
Method that remove an event handler.
+ (void)removeServerPushEvent:(void ( ^ ) ( TCGBServerPushMessage *))handler
Availability
Added 1.8.0.
Discussion
Usage Example
- (void)removeServerPushEventHandler { void(^pushHandler)(TCGBServerPushMessage ) = ^(TCGBServerPushMessage message) { NSString* msg = [NSString stringWithFormat:@“[Sample] receive server push =>\ntype: %@\ndata: %@”, message.type, message.data]; [self printLogAndShowAlertWithData:msg error:nil alertTitle:@“server push”]; }; [TCGBGamebase removeServerPushEvent:pushHandler]; }
Declared In
TCGBGamebase.h
+ removeAllServerPushEvent
Method that remove all handlers.
+ (void)removeAllServerPushEvent
Availability
Added 1.8.0.
Declared In
TCGBGamebase.h
+ addObserver:
Method that add an observer handler to notify status changed by LaunchingStatus, Network Monitoring, User Info (ban). You can see the constants of message type in TCGBConstants.h (kTCGBObserverMessageTypeNetwork, kTCGBObserverMessageTypeLaunching, kTCGBObserverMessageTypeHeartbeat).
+ (void)addObserver:(void ( ^ ) ( TCGBObserverMessage *))handler
Availability
Added 1.8.0.
Discussion
Usage Example
(void)addObserverHandler { void(^observerHandler)(TCGBObserverMessage ) = ^(TCGBObserverMessage message) { NSString* msg = [NSString stringWithFormat:@“[Sample] receive from observer =>\ntype: %@\ndata: %@”, message.type, message.data]; [self printLogAndShowAlertWithData:msg error:nil alertTitle:@“Observer”]; };
[TCGBGamebase addObserver:observerHandler]; }
Declared In
TCGBGamebase.h
+ removeObserver:
Method that remove an observer handler.
+ (void)removeObserver:(void ( ^ ) ( TCGBObserverMessage *))handler
Availability
Added 1.8.0.
Discussion
Usage Example
(void)removeObserverHandler { void(^observerHandler)(TCGBObserverMessage ) = ^(TCGBObserverMessage message) { NSString* msg = [NSString stringWithFormat:@“[Sample] receive from observer =>\ntype: %@\ndata: %@”, message.type, message.data]; [self printLogAndShowAlertWithData:msg error:nil alertTitle:@“Observer”]; };
[TCGBGamebase removeObserver:observerHandler]; }
Declared In
TCGBGamebase.h
+ removeAllObserver
Method that remove all observer handlers.
+ (void)removeAllObserver
Availability
Added 1.8.0.
Declared In
TCGBGamebase.h
+ queryTransferAccountWithCompletion:
Use this method to retrieve already published Transfer Account information.
+ (void)queryTransferAccountWithCompletion:(TransferAccountCompletion)completion
Parameters
completion |
Handler to receive TransferAccount inforamtion. |
---|
Availability
Added 2.1.0.
Discussion
Usage Example
- (void)queryTransferAccount { [TCGBGamebase queryTransferAccountWithCompletion:^(TCGBTransferAccountInfo transferAccount, TCGBError error) { NSLog(@“Published TransferAccount => %@, error => %@”, [transferAccount description], [error description]); }]; }
Declared In
TCGBGamebase.h
+ issueTransferAccountWithCompletion:
If you want to transfer an account that is guest to other device. You can use this method to publish id and password that called Transfer Account. To publish Transfer Account, an account must be logged in by Guest. After transfering guest account to other device, guest account on this device will be logged out and will not be able to authenticate with same guest account.
+ (void)issueTransferAccountWithCompletion:(TransferAccountCompletion)completion
Parameters
completion |
Handler to receive TransferAccount inforamtion and an error. |
---|
Availability
Added 2.1.0.
Discussion
Usage Example
- (void)issueTransferAccount { [TCGBGamebase issueTransferAccountWithCompletion:^(TCGBTransferAccountInfo transferAccount, TCGBError error) { NSLog(@“Issued TransferAccount => %@, error => %@”, [transferAccount description], [error description]); }]; }
Declared In
TCGBGamebase.h
+ renewTransferAccountWithConfiguration:completion:
Use this method to change Transfer Account id or password.
+ (void)renewTransferAccountWithConfiguration:(TCGBTransferAccountRenewConfiguration *)config completion:(TransferAccountCompletion)completion
Parameters
config |
Configuration for Transfer Account renewal. |
---|---|
completion |
Handler to receive TransferAccount inforamtion and an error. |
Availability
Added 2.1.0
Declared In
TCGBGamebase.h
+ transferAccountWithIdPLoginWithAccountId:accountPassword:completion:
This method transfer the guest account to other device. If result is success, the guest account can be logged in to new device and logged out from old device.
+ (void)transferAccountWithIdPLoginWithAccountId:(NSString *)accountId accountPassword:(NSString *)accountPassword completion:(void ( ^ ) ( TCGBAuthToken *authToken , TCGBError *error ))completion
Parameters
accountId |
TransferAccount id received from old device. |
---|---|
accountPassword |
TransferAccount password from old device. |
completion |
Handler that include guest login informations and errors. |
Availability
Added 2.1.0.
Discussion
Usage Example
- (void)transferOtherDevice { [TCGBGamebase transferAccountWithIdPLoginWithAccountId:@“1Aie0198” accountPassword:@“1Aie0199” completion:^(TCGBAuthToken authToken, TCGBError error) { NSLog(@“Transfered => %@”,\nerror => %@“, [authToken description], [error description]); }]; }
Declared In
TCGBGamebase.h
+ application:willFinishLaunchingWithOptions:
If you implement custom AuthAdapter with TCGBAuthAdapterDelegate to support custom IDPs and you need to be called ‘application:willFinishLaunchingWithOptions:’ in your adapter class. This method must be called in ‘UIApplicationDelegate application:willFinishLaunchingWithOptions:’ method.
+ (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Parameters
application |
Your singleton app object from UIApplication. |
---|---|
launchOptions |
A dictionary indicating the reason the app will launch. |
Discussion
This method is optional.
Usage Example
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return [TCGBGamebase application:application willFinishLaunchingWithOptions:launchOptions];
}
Declared In
TCGBGamebase.h
+ application:didFinishLaunchingWithOptions:
If you implement custom AuthAdapter with TCGBAuthAdapterDelegate to support custom IDPs and you need to be called ‘application:didFinishLaunchingWithOptions:’ in your adapter class. This method must be called in ‘UIApplicationDelegate application:didFinishLaunchingWithOptions:’ method.
+ (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
Parameters
application |
Your singleton app object from UIApplication. |
---|---|
launchOptions |
A dictionary indicating the reason the app was launched. |
Discussion
This method is optional.
Usage Example
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return [TCGBGamebase application:application didFinishLaunchingWithOptions:launchOptions];
}
Declared In
TCGBGamebase.h
+ application:didReceiveRemoteNotification:fetchCompletionHandler:
Responding to Notifications and Events
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult result ))completionHandler
Declared In
TCGBGamebase.h
+ application:openURL:options:
If you implement custom AuthAdapter with TCGBAuthAdapterDelegate to support custom IDPs and you need to be called ‘application:openURL:options:’ in your adapter class. This method must be called in ‘UIApplicationDelegate application:openURL:options:’ method.
+ (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
Parameters
app |
Your singleton app object from UIApplication. |
---|---|
url |
The URL resource to open. |
options |
A dictionary of URL handling options. |
Return Value
YES if the delegate sucessfully handled the request or NO if the attempt to open the URL resource failed.
Availability
iOS 9.0 <=
Discussion
This method is optional.
Usage Example
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
return [TCGBGamebase application:app openURL:url options:options];
}
Declared In
TCGBGamebase.h
+ application:openURL:sourceApplication:annotation:
If you implement custom AuthAdapter with TCGBAuthAdapterDelegate to support custom IDPs and you need to be called ‘application:openURL:sourceApplication:annotation:’ in your adapter class. This method must be called in ‘UIApplicationDelegate application:openURL:sourceApplication:annotation:’ method.
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
Parameters
application |
Your singleton app object from UIApplication. |
---|---|
url |
The URL resource to open. |
sourceApplication |
The bundle ID of the app that is requesting your app to open the URL. |
annotation |
A Property list supplied by the source app to communicate information to the receiving app. |
Return Value
YES if the delegate sucessfully handled the request or NO if the attempt to open the URL resource failed.
Availability
iOS 4.2 ~ 8.x
Discussion
This method is optional.
Usage Example
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [TCGBGamebase application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}
Declared In
TCGBGamebase.h
+ application:handleOpenURL:
If you implement custom AuthAdapter with TCGBAuthAdapterDelegate to support custom IDPs and you need to be called ‘application:handleOpenURL:’ in your adapter class. This method must be called in ‘UIApplicationDelegate application:handleOpenURL:’ method.
+ (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
Parameters
application |
Your singleton app object from UIApplication. |
---|---|
url |
The URL resource to open. |
Return Value
YES if the delegate sucessfully handled the request or NO if the attempt to open the URL resource failed.
Availability
iOS 4.2 ~ 8.x
Discussion
This method is optional.
Usage Example
+ (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
return [TCGBGamebase application:application handleOpenURL:url];
}
Declared In
TCGBGamebase.h
deprecated Methods
+ languageCode
As of release 1.14.0, use deviceLanguageCode method instead. (Deprecated: As of release 1.14.0, use deviceLanguageCode method instead.)
+ (NSString *)languageCode
Availability
Added 1.4.0.
Declared In
TCGBGamebase.h