16.1. System Information SDK Example
16.1. System Information SDK Example
16.1.1. Retrieving language code
The language setting information in the device is retrieved. The language code returns a value in accordance with the ISO 639-1 codes.
Unity
using Kakaogame.SDK;
string languageCode = KGSystem.languageCode; |
Android
String languageCode = KGSystem.getLanguageCode(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *languageCode = [KGSystem languageCode]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
std::wstring languageCode = kgSystem.getLanguageCode();
|
Unreal
#include "KakaoGame.h"
FString languageCode = FKGSystem::GetLanguageCode(); |
16.1.2 Retrieving language tag
The language setting information in the device is retrieved. The language tag returns a value in accordance with the BCP-47 codes. (SDK 3.17.5 or higher)
Unity
using Kakaogame.SDK;
string languageTag = KGSystem.languageTag; |
Android
String languageTag = KGSystem.getLanguageTag(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *languageTag = [KGSystem languageTag]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
std::wstring languageTag = kgSystem.getLanguageTag(); |
Unreal
#include "KakaoGame.h"
FString languageTag = FKGSystem::GetLanguageCode(); |
16.1.3. Retrieving country code
Devices supporting 3g/LTE return a country code issued by the communication module. WIFI-only devices return a country code set in the device. (SDK 3.7.0 or higher) For wifi-only devices, the country code is collected based on GeoIP. If it fails to import GeoIP, it will be collected as the country information of the device.
The country code is in accordance with the ISO 3166-1 alpha-2 code, and returns
zz
if there is no country informationThe country code set in the first app execution will remain. If the app or app information is deleted, the country code is re-set
Unity
using Kakaogame.SDK;
string countryCode = KGSystem.countryCode; |
Android
String countryCode = KGSystem.getCountryCode(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *countryCode = [KGSystem countryCode]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
std::wstring countryCode = kgSystem.getCountryCode();
|
Unreal
#include "KakaoGame.h"
FString countryCode = FKGSystem::GetCountryCode(); |
16.1.4. Getting Device ID
Device ID returns a value which is used to identify the device. It changes when the device is reset.
Unity
using Kakaogame.SDK;
string deviceId = KGSystem.deviceId; |
Android
String deviceId = KGSystem.getDeviceId(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *deviceId = [KGSystem deviceId]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
std::wstring deviceId = kgSystem.getDeviceId();
|
Unreal
#include "KakaoGame.h"
FString deviceId = FKGSystem::GetDeviceId(); |
16.1.5. Getting Device Model
The model information of the current device is returned.
Unity
using Kakaogame.SDK;
string deviceModel = KGSystem.deviceModel; |
Android
String deviceModel = KGSystem.getDeviceModel(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *deviceModel = [KGSystem deviceModel]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
std::wstring deviceModel = kgSystem.getDeviceModel();
|
Unreal
#include "KakaoGame.h"
FString deviceModel = FKGSystem::GetDeviceModel(); |
16.1.6. Getting OS name
The name of OS (android/ios) of the current device is returned.
Unity
using Kakaogame.SDK;
string osName = KGSystem.osName; |
Android
String osName = KGSystem.getOSName(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *osName = [KGSystem osName]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
std::wstring osName = kgSystem.getOSName();
|
Unreal
#include "KakaoGame.h"
FString osName = FKGSystem::GetOSName(); |
16.1.7. Getting network connection status
Shows whether the current device is connected to an external network.
Unity
using Kakaogame.SDK;
bool isNetworkConnected = KGSystem.isNetworkConnected; |
Android
boolean networkConnected = KGSystem.isNetworkConnected(); |
iOS
#import <KakaoGame/KakaoGame.h>
BOOL isNetworkConnected = [KGSystem isNetworkConnected]; |
Windwos
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
bool networkConnected = kgSystem.isNetworkConnected();
|
Unreal
#include "KakaoGame.h"
bool isNetworkConnected = FKGSystem::IsNetworkConnected(); |
16.1.8. Get connected network type
Shows what type of external network is connected to the current device. (wifi/cellular/unknown)
Unity
using Kakaogame.SDK;
string networkType = KGSystem.networkType; |
Android
String networkType = KGSystem.getNetworkType(); |
iOS
#import <KakaoGame/KakaoGame.h>
NSString *networkType = [KGSystem networkType]; |
Windows
#include "KakaoGameLib.h"
KakaoGame::SDK::KGSystem kgSystem;
// Offline/LAN/Modem/Proxy
std::wstring networkType = kgSystem.getNetworkType();
|
Unreal
#include "KakaoGame.h"
FString networkType = FKGSystem::GetNetworkType(); |