TCGBUtil Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | TCGBUtil.h |
Utilities
+ appVersion
Gamebase Config Information
+ (NSString *)appVersionReturn Value
Gamebase Config Information
Declared In
TCGBUtil.h
+ gamebaseVersion
Gamebase Version
+ (NSString *)gamebaseVersionReturn Value
Gamebase Version
Declared In
TCGBUtil.h
+ appTrackingAuthorizationStatus
App Tracking AuthorizationStatus
+ (TCGBAppTrackingAuthorizationStatus)appTrackingAuthorizationStatusReturn Value
App Tracking AuthorizationStatus
Declared In
TCGBUtil.h
+ idfa
IDFA, Advertising Identifier.
+ (NSString *)idfaReturn Value
IDFA, Advertising Identifier.
Declared In
TCGBUtil.h
+ idfv
IDFV, Vendor Identifier.
+ (NSString *)idfvReturn Value
IDFV, Vendor Identifier.
Declared In
TCGBUtil.h
+ uuid
UUID, 4 random bytes string.
+ (NSString *)uuidReturn Value
UUID, 4 random bytes string.
Declared In
TCGBUtil.h
+ osCode
OS Code, actually “IOS”.
+ (NSString *)osCodeReturn Value
OS Code, actually “IOS”.
Declared In
TCGBUtil.h
+ osVersionSeperatedByDot
OS Version dot-formatted.
+ (NSArray<NSString*> *)osVersionSeperatedByDotReturn Value
OS Version dot-formatted.
Declared In
TCGBUtil.h
+ isiOSVersion:orLater:
YES if majorVersion is greater than or equal to majorVersion.
+ (BOOL)isiOSVersion:(int)majorVersion orLater:(BOOL)laterParameters
majorVersion |
version to be compared with OS version. |
|---|---|
later |
if this value sets YES, it returns whether OS version is greater than or equal to majorVersion. |
Return Value
YES if majorVersion is greater than or equal to majorVersion.
Declared In
TCGBUtil.h
+ deviceModel
Device model.
+ (NSString *)deviceModelReturn Value
Device model.
Declared In
TCGBUtil.h
+ detailDeviceModel
Detail Device model.
+ (NSString *)detailDeviceModelReturn Value
Detail Device model.
Declared In
TCGBUtil.h
+ deviceLanguageCode
Preferred launguage.
+ (NSString *)deviceLanguageCodeReturn Value
Preferred launguage.
Availability
Added 1.14.0.
Declared In
TCGBUtil.h
+ deviceLocaleLanguageCode
language code by NSLocaleLanguageCode of NSLocale. (ex. “en”, “ko”, “ja”, “zh”, “vi”)
+ (NSString *)deviceLocaleLanguageCodeReturn Value
language code by NSLocaleLanguageCode of NSLocale. (ex. “en”, “ko”, “ja”, “zh”, “vi”)
Declared In
TCGBUtil.h
+ bundleID
Main bundle’s identifier.
+ (NSString *)bundleIDReturn Value
Main bundle’s identifier.
Declared In
TCGBUtil.h
+ displayName
DisplayName.
+ (NSString *)displayNameReturn Value
DisplayName.
Declared In
TCGBUtil.h
+ unixEpochTime
Unix epoch time, it is millisecods, 13 digits.
+ (uint64_t)unixEpochTimeReturn Value
Unix epoch time, it is millisecods, 13 digits.
Declared In
TCGBUtil.h
+ extractValueFrom:searchString:
value object which is in the json formatted dictionary and have a dottedString key.
+ (id)extractValueFrom:(NSDictionary *)json searchString:(NSString *)dottedStringReturn Value
value object which is in the json formatted dictionary and have a dottedString key.
## Example
NSDictionary json;
json = @{
@"key1" : @"value1",
@"key2" : @{
@"key2-1" : @"value2-1",
@"key2-2" : @[@"value2-2[0]", @"value2-2[1]"]
},
@"key3" : @"value3"
}
NSString *dottedString = @"key2.key2-2[1]";
NSString *extractedString = [TCGBUtil extractValueFrom:json searchString:dottedString];
NSLog(@"%@", extractedString);
// It would be > "value2-2[1]"
Declared In
TCGBUtil.h
+ dictionaryFrom:
Returns an object converted from json string to dictionary.
+ (nullable NSDictionary *)dictionaryFrom:(NSString *)jsonStringReturn Value
Returns an object converted from json string to dictionary.
Declared In
TCGBUtil.h
Encoding
+ isURLEncoded:
YES if the targetString is URL encoded.
+ (BOOL)isURLEncoded:(NSString *)targetStringReturn Value
YES if the targetString is URL encoded.
Declared In
TCGBUtil.h
+ URLEncodedString:
URL Encoded String.
+ (nullable NSString *)URLEncodedString:(NSString *)stringParameters
string |
The string to be encoded. |
|---|
Return Value
URL Encoded String.
Declared In
TCGBUtil.h
+ URLEncodedStringWithData:
URL Encoded String.
+ (nullable NSString *)URLEncodedStringWithData:(NSData *)dataParameters
data |
The data to be encoded. |
|---|
Return Value
URL Encoded String.
Declared In
TCGBUtil.h
System UI
+ showToastWithMessage:length:
Show Toast.
+ (void)showToastWithMessage:(NSString *)message length:(GamebaseToastLength)lengthParameters
message |
The message to be shown in the toast. |
|---|---|
length |
The time interval to be exposed. GamebaseToastLengthLong (3.5 seconds), GamebaseToastLengthShort (2 seconds) |
Declared In
TCGBUtil.h
+ showAlertWithViewController:title:message:completion:
Show Alert View with async completion handler
+ (void)showAlertWithViewController:(UIViewController *)viewController title:(nullable NSString *)title message:(nullable NSString *)message completion:(void ( ^ _Nullable ) ( void ))completionParameters
viewController |
The viewController that will display the alert |
|---|---|
title |
The title of alert |
message |
The message of alert |
completion |
The callback of alert when user has tapped the ‘OK(확인)’ button |
Declared In
TCGBUtil.h
+ showAlertWithTitle:message:completion:
Show Alert View with async completion handler
+ (void)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)message completion:(void ( ^ _Nullable ) ( void ))completionParameters
title |
The title of alert |
|---|---|
message |
The message of alert |
completion |
The callback of alert when user has tapped the ‘OK(확인)’ button |
Declared In
TCGBUtil.h
+ showAlertWithTitle:message:
Show Alert View
+ (void)showAlertWithTitle:(nullable NSString *)title message:(nullable NSString *)messageParameters
title |
The title of alert |
|---|---|
message |
The message of alert |
Declared In
TCGBUtil.h
Logging
+ logVerboseWithFormat:
Verbose Log
+ (void)logVerboseWithFormat:(NSString *)format, ...Parameters
format |
Log |
|---|
Declared In
TCGBUtil.h
+ logDebugWithFormat:
Debug Log
+ (void)logDebugWithFormat:(NSString *)format, ...Parameters
format |
Log |
|---|
Declared In
TCGBUtil.h
+ logInfoWithFormat:
Info Log
+ (void)logInfoWithFormat:(NSString *)format, ...Parameters
format |
Log |
|---|
Declared In
TCGBUtil.h
+ logWarnWithFormat:
Warning Log
+ (void)logWarnWithFormat:(NSString *)format, ...Parameters
format |
Log |
|---|
Declared In
TCGBUtil.h
+ logErrorWithFormat:
Error Log
+ (void)logErrorWithFormat:(NSString *)format, ...Parameters
format |
Log |
|---|
Declared In
TCGBUtil.h
+ logWithString:
Log
+ (void)logWithString:(NSString *)logStringParameters
logString |
Log |
|---|
Declared In
TCGBUtil.h
Etc
+ colorFromHexString:
Convert color hex string to UIColor
+ (UIColor *)colorFromHexString:(NSString *)hexStringParameters
hexString |
The color hex string such as #RGB, #ARGB, #RRGGBB, #RRGGBBAA. |
|---|
Return Value
UIColor.
Declared In
TCGBUtil.h
deprecated Methods
+ deviceLanguage
As of release 1.14.0, use deviceLanguageCode method instead. (Deprecated: As of release 1.14.0, use deviceLanguageCode method instead.)
+ (NSString *)deviceLanguageAvailability
Added 1.4.0.
Declared In
TCGBUtil.h
+ country
As of release 1.14.0, use countryCode method instead. (Deprecated: As of release 1.14.0, use countryCode method instead.)
+ (NSString *)countryReturn Value
ISO country code. First, usimCountryCode is returned, if there is not usim, deviceCountryCode is returned.
Availability
Added 1.4.0.
See Also
Declared In
TCGBUtil.h
+ countryCode
As of release 2.52.0, use deviceCountryCode method instead. (Deprecated: As of release 2.52.0, use deviceCountryCode method instead.)
+ (NSString *)countryCodeReturn Value
ISO country code. First, usimCountryCode is returned, if there is not usim, deviceCountryCode is returned.
Availability
Added 1.14.0.
See Also
Declared In
TCGBUtil.h
+ usimCountryCode
As of release 2.52.0, returns ‘ZZ’ since iOS 16.4. (Deprecated: As of release 2.52.0, returns ‘ZZ’ since iOS 16.4.)
+ (NSString *)usimCountryCodeReturn Value
Usim country code is returned. If there is not usim, ‘ZZ’ is returned.
Availability
Added 1.4.0.
Declared In
TCGBUtil.h
+ carrierCode
As of release 2.52.0, returns nil since iOS 16.4. (Deprecated: As of release 2.52.0, returns nil since iOS 16.4.)
+ (NSString *)carrierCodeReturn Value
Cellular service provider’s code.
Availability
Added 1.4.0.
Declared In
TCGBUtil.h
+ carrierName
As of release 2.52.0, returns nil since iOS 16.4. (Deprecated: As of release 2.52.0, returns nil since iOS 16.4.)
+ (NSString *)carrierNameReturn Value
Cellular service provider’s name.
Availability
Added 1.4.0.
Declared In
TCGBUtil.h