...
Initialization and Status Change Event Processing
...
SDK Initialization
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
std::map<std::wstring, std::wstring> kakaoSetting, facebookSetting, googleSetting; kakaoSetting.insert(std::pair<std::wstring, std::wstring>(TEXT("jsKey"), TEXT("acd84e5c92067a159573483d8877de67"))); facebookSetting.insert(std::pair<std::wstring, std::wstring>(TEXT("clientId"), TEXT("1421382574931990"))); googleSetting.insert(std::pair<std::wstring, std::wstring>(TEXT("clientId"), TEXT("1002041625464-s2ruvcn1auv3rksr799gb4matvtvppb5.apps.googleusercontent.com"))); googleSetting.insert(std::pair<std::wstring, std::wstring>(TEXT("clientSecret"), TEXT("5MtQUUZ1sHl7RYgrhee-7-22"))); std::map<KakaoGame::Data::KGTIdpCode, std::map<std::wstring, std::wstring>> idpSettings; idpSettings.insert(std::pair<KakaoGame::Data::KGTIdpCode, std::map<std::wstring, std::wstring>>(KakaoGame::Data::KGTIdpCode::Kakao, kakaoSetting)); idpSettings.insert(std::pair<KakaoGame::Data::KGTIdpCode, std::map<std::wstring, std::wstring>>(KakaoGame::Data::KGTIdpCode::Facebook, facebookSetting)); idpSettings.insert(std::pair<KakaoGame::Data::KGTIdpCode, std::map<std::wstring, std::wstring>>(KakaoGame::Data::KGTIdpCode::Google, googleSetting)); /** * For using a single app */ KakaoGame::Data::KGTConfig config; config.setAppInfo( TEXT("909428"), // appID TEXT("c3c38bbfa3828b342d946e9770c974d0"), // appSecret TEXT("1.0.0"), // appVersion TEXT("gameWeb"), // market TEXT("14"), // ageRating KakaoGame::Data::KGTServerType::QA, // server type KakaoGame::Data::KGTLogLevel::Error, // log level idpSettings // idpSettings ); /** * For using an app group */ std::map<std::wstring, std::wstring> apps; apps.insert(std::pair<std::wstring, std::wstring>(TEXT("909428"), TEXT("c3c38bbfa3828b342d946e9770c974d0"))); apps.insert(std::pair<std::wstring, std::wstring>(TEXT("921478"), TEXT("5891c32124ca35821890a0bc1cec77a5"))); apps.insert(std::pair<std::wstring, std::wstring>(TEXT("921482"), TEXT("43d0abf4ba4025994068607c545f04dc"))); apps.insert(std::pair<std::wstring, std::wstring>(TEXT("947947"), TEXT("3c7fde7309a1fad65961110e8e290e28"))); apps.insert(std::pair<std::wstring, std::wstring>(TEXT("947950"), TEXT("7cc67cba7e3406585543d493f1548473"))); config.setAppGroupInfos( TEXT("tubeAppGroup"), // appGroupId apps, // app info map TEXT("1.0.0"), // appVersion TEXT("gameWeb"), // market TEXT("14"), // ageRating KakaoGame::Data::KGTServerType::QA, // server type KakaoGame::Data::KGTLogLevel::Error, // log level idpSettings // idpSettings ); KakaoGame::API::KGTApplication applicationApi; applicationApi.initSDK(config); |
Start
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::Data::KGTResult result; KakaoGame::API::KGTApplication applicationApi; applicationApi.start(GetSafeHwnd(), result); if (result.isSuccess()) { // If the start is successful // Check if auto-login is enabled KakaoGame::API::KGTPlayer playerApi; boolean isLoggedIn = playerApi.isLoggedIn(); if (isLoggedIn) { // The current Player's ID issued by the platform KakaoGame::Data::KGTPlayer player; playerApi.getCurrentPlayer(player); std::wstring playerId = player.playerId; // The current Player ID issued by the platform std::wstring accessToken = playerApi.getAccessToken(); // Platform access token (AccessToken) // [TODO] Move to the game screen } else { // [TODO] If auto-login is not enabled, move to the login screen } } else { // If the start fails - Ifsince initialization failsfailed, you should either retry the start or close the app. if (KakaoGame::Data::KGTResultCode::NetworkFailure == result.code || KakaoGame::Data::KGTResultCode::ServerTimeout == result.code || KakaoGame::Data::KGTResultCode::ConnectionFailed == result.code) { // [TODO] If a network error occurs, notify the user ofthat the networkstart issuefailed anddue theto failurea tonetwork start,issue thenand retry. } else { // [TODO] If other errors occur, notifyprovide thean user of the errorerror notification and request a retry of the start process. - If the issue persists, check the error code and logs to determine the cause. } } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTApplication applicationApi; applicationApi.start(GetSafeHwnd(), [this](KakaoGame::Data::KGTResult result) { if (result.isSuccess()) { // If the start is successful // Check if auto-login is enabled KakaoGame::API::KGTPlayer playerApi; bool isLoggedIn = playerApi.isLoggedIn(); if (isLoggedIn) { // Get the current Player ID issued by the platform KakaoGame::Data::KGTPlayer player; playerApi.getCurrentPlayer(player); std::wstring playerId = player.playerId; // The current Player ID issued by the platform std::wstring accessToken = playerApi.getAccessToken(); // Platform access token (AccessToken) // [TODO] Move to the game screen } else { // [TODO] If auto-login is not enabled, move to the login screen } } else { // If the start fails - Sincesince initialization failed, retry the start or close the app. if (KakaoGame::Data::KGTResultCode::NetworkFailure == result.code || KakaoGame::Data::KGTResultCode::ServerTimeout == result.code || KakaoGame::Data::KGTResultCode::ConnectionFailed == result.code) { // [TODO] If a network error occurs, notify the user ofthat the networkstart issuefailed anddue theto failurea tonetwork start,issue thenand retry. } else { // [TODO] If other errors occur, notifyprovide thean usererror ofnotification the error and request a retry of the start process. - If the issue persists, check the error code and logs to determine the cause. } } }); |
Login
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Logging In Without Using the Default Login UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // Setting the idpCode for login KakaoGame::Data::KGTIdpCode idpCode = KakaoGame::Data::KGTIdpCode::Kakao; KakaoGame::Data::KGTResult result; KakaoGame::API::KGTPlayer playerApi; playerApi.login(GetSafeHwnd(), idpCode, result); if (result.isSuccess()) { // IDP login and platform login successful KakaoGame::Data::KGTPlayer player; KakaoGame::API::KGTPlayer playerApi; playerApi.getCurrentPlayer(player); std::wstring playerId = player.playerId; // Current Player ID issued by the platform std::wstring accessToken = playerApi.getAccessToken(); // Platform access token (AccessToken) // [TODO] Since the login iswas successful, proceed to the game screen. } else { // IDP login or platform login failed // [TODO] InIf case of login failurefails, notifyinform the user and prompt them to retry. if (KakaoGame::Data::KGTResultCode::NetworkFailure == result.code || KakaoGame::Data::KGTResultCode::ServerTimeout == result.code || KakaoGame::Data::KGTResultCode::ConnectionFailed == result.code) { // [TODO] If a network error occurs, notify the user ofthat the networkstart issuefailed anddue theto failurea tonetwork start,issue thenand retry. } else if (KakaoGame::Data::KGTResultCode::Forbidden == result.code) { // [TODO] During the CBT period, authentication may not be possible for users who are not permitted. Notifyallowed. Provide an appropriate notification to the user accordingly. } else if (KakaoGame::Data::KGTResultCode::UserCanceled == result.code) { // [TODO] IfSince the user cancelscanceled during the login process, maintain the login screen should be maintained. } else { // [TODO] If other errors occur, notifyprovide thean usererror ofnotification the error and request a retry of the start process. - If the issue persists, check the error code and logs to determine the cause. } } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // Set the idpCode you want to log in with KakaoGame::Data::KGTIdpCode idpCode = KakaoGame::Data::KGTIdpCode::Kakao; KakaoGame::API::KGTPlayer playerApi; playerApi.login(GetSafeHwnd(), idpCode, [this](KakaoGame::Data::KGTResult result) { if (result.isSuccess()) { // Successfully logged in with IDP and platform KakaoGame::Data::KGTPlayer player; KakaoGame::API::KGTPlayer playerApi; playerApi.getCurrentPlayer(player); std::wstring playerId = player.playerId; // The current Player ID issued by the platform std::wstring accessToken = playerApi.getAccessToken(); // Platform access token (AccessToken) // [TODO] Since the login iswas successful, proceed to the game screen. } else { // IDP login or platform login failed // [TODO] After notifyingIf login fails, inform the user ofand theprompt loginthem failure,to retry the login. if (KakaoGame::Data::KGTResultCode::NetworkFailure == result.code || KakaoGame::Data::KGTResultCode::ServerTimeout == result.code || KakaoGame::Data::KGTResultCode::ConnectionFailed == result.code) { // [TODO] If a network error occurs, notify the user ofthat the networkstart issuefailed anddue theto failurea tonetwork start,issue thenand retry. } else if (KakaoGame::Data::KGTResultCode::Forbidden == result.code) { // [TODO] If the user is not allowed during the CBT period, authentication may not be possible. Provide a notification message to the user. } else if (KakaoGame::Data::KGTResultCode::UserCanceled == result.code) { // [TODO] IfSince the user cancelscanceled during the login process, maintain the login screen should be maintained. } else { // [TODO] If other errors occur, notifyprovide thean user of the errorerror notification and request a retry of the start process. - If the issue persists, check the error code and logs to determine the cause. } } }); |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // User ID requesting login std::wstring playerId; // Token received from Square std::wstring squareToken; KakaoGame::Data::KGTResult result; KakaoGame::API::KGTPlayer playerApi; playerApi.loginIdpWithSquareToken(GetSafeHwnd(), playerId, squareToken, result); if (result.isSuccess()) { // Successful IDP and platform login KakaoGame::Data::KGTPlayer player; KakaoGame::API::KGTPlayer playerApi; playerApi.getCurrentPlayer(player); std::wstring playerId = player.playerId; // Current Player ID issued by the platform std::wstring accessToken = playerApi.getAccessToken(); // Platform access token (AccessToken) // [TODO] Since login iswas successful, proceed to the game screen. } else { // IDP or platform login failed // [TODO] If login fails, notify the user and request a retry. if (KakaoGame::Data::KGTResultCode::NetworkFailure == result.code || KakaoGame::Data::KGTResultCode::ServerTimeout == result.code || KakaoGame::Data::KGTResultCode::ConnectionFailed == result.code) { // [TODO] If a network error occurs, notify the user ofthat the networkstart issuefailed anddue theto failurea tonetwork start,issue thenand retry. } else { // [TODO] If other errors occur, notifyprovide thean user of the errorerror notification and request a retry of the start process. - If the issue persists, check the error code and logs to determine the cause. } } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // User ID requesting login std::wstring playerId; // Token received from Square std::wstring squareToken; KakaoGame::API::KGTPlayer playerApi; playerApi.login(GetSafeHwnd(), playerId, squareToken, [this](KakaoGame::Data::KGTResult result) { if (result.isSuccess()) { // IDP login and platform login successful KakaoGame::Data::KGTPlayer player; KakaoGame::API::KGTPlayer playerApi; playerApi.getCurrentPlayer(player); std::wstring playerId = player.playerId; // The current Player's ID issued by the platform std::wstring accessToken = playerApi.getAccessToken(); // Platform access token (AccessToken) // [TODO] Since login iswas successful, proceed to the game screen. } else { // IDP login or platform login failed // [TODO] If login fails, notify the user and request a retry. if (KakaoGame::Data::KGTResultCode::NetworkFailure == result.code || KakaoGame::Data::KGTResultCode::ServerTimeout == result.code || KakaoGame::Data::KGTResultCode::ConnectionFailed == result.code) { // [TODO] If a network error occurs, notify the user ofthat the networkstart issuefailed anddue theto failurea tonetwork start,issue thenand retry.. } else { // [TODO] If other errors occur, notifyprovide thean usererror ofnotification the error and request a retry of the start process. - If the issue persists, check the error code and logs to determine the cause. } } }); |
Logout
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Logging Out Without Using the Default Logout UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTPlayer playerApi; playerApi.unregister(GetSafeHwnd(), false, [this](KakaoGame::Data::KGTResult result) { if (result.isSuccess()) { // Unregistration successful // [TODO] Return to the start screen } else { // Unregistration failed } }); |
Account Linking
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Linking Accounts Without Using the Default Account Linking UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve My Information
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve My IDP Information
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve Language Code
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve Language Tag
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve Country Code
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve IP-based Country Code
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTSystem systemApi; std::wstring countryCode = systemApi.getGeoCountryCode(); |
Retrieve Device ID
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve Device Model
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTSystem systemApi; std::wstring deviceModel = systemApi.getDeviceModel(); |
Retrieve OS Name
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve Network Connection Status
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Retrieve Connected Network Type
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
Setting Up KakaoTalk Game Message Reception
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::Data::KGTResult result; bool isAlloweMe; KakaoGame::API::KGTKakaoTalk kakaotalkApi; // ShowDisplay the view to set whetherKakaoTalk togame receivemessage KakaoTalkreception game messagespreferences kakaotalkApi.showSetting(GetSafeHwnd(), result, isAlloweMe); if (result.isSuccess()) { // Successfully set whetherthe toKakaoTalk receivegame KakaoTalkmessage gamereception messagessettings isAlloweMe; // IndicatesWhether whethermessage receivingreception messages is allowed as per the settings } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with KakaoStory Kakaoand not StoryKakaoTalk. } else { // Failed to set whetherthe toKakaoTalk receivegame KakaoTalkmessage gamereception messagessettings } |
Asynchronous Example
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTKakaoTalk kakaotalkApi; // ShowDisplay the view to set whetherKakaoTalk togame receivemessage KakaoTalkreception gamepreferences messages kakaotalkApi.showSetting(GetSafeHwnd(), [this](KakaoGame::Data::KGTResult result, bool isAlloweMe) { if (result.isSuccess()) { // Successfully set whetherthe toKakaoTalk receivegame KakaoTalkmessage gamereception messagessettings isAlloweMe; // IndicatesWhether whethermessage receivingreception messages is allowed as per the settings } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with Kakao StoryKakaoStory and not KakaoTalk. } else { // Failed to set whetherthe toKakaoTalk receivegame KakaoTalkmessage gamereception messagessettings } }); |
Retrieve KakaoTalk Profile
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::Data::KGTResult result; KakaoGame::Data::KGTKakaoTalkProfile profile; KakaoGame::API::KGTKakaoTalk kakaotalkApi; // Retrieve KakaoTalk profile kakaotalkApi.talkProfile(result, profile); if (result.isSuccess()) { // Successfully retrieved KakaoTalk profile profile; // KakaoTalk profile information of the logged-in user } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that when the user is only registered with Kakao StoryKakaoStory and not KakaoTalk. } else { // Failed to retrieve KakaoTalk profile } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTKakaoTalk kakaotalkApi; // Retrieve KakaoTalk profile kakaotalkApi.talkProfile([this](KakaoGame::Data::KGTResult result, KakaoGame::Data::KGTKakaoTalkProfile profile) { if (result.isSuccess()) { // Successfully retrieved KakaoTalk profile profile; // KakaoTalk profile information of the logged-in user } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with KakaoStory and Kakaonot StoryKakaoTalk. } else { // Failed to retrieve KakaoTalk profile } }); |
Retrieve KakaoTalk Game Friend List
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::Data::KGTResult result; std::vector<KakaoGame::Data::KGTPlayer> players; KakaoGame::API::KGTKakaoTalk kakaotalkApi; // Retrieve the list of game friends kakaotalkApi.friends(result, players); if (result.isSuccess()) { // Successfully retrieved KakaoTalk game friends list. // Game friends list for each (auto player in players) { } } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with Kakao StoryKakaoStory and not KakaoTalk. } else { // Failed to retrieve KakaoTalk profile } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" KakaoGame::API::KGTKakaoTalk kakaotalkApi; // Retrieve the list of game friends kakaotalkApi.friends([this](KakaoGame::Data::KGTResult result, std::vector<KakaoGame::Data::KGTPlayer> players) { if (result.isSuccess()) { // Successfully retrieved KakaoTalk game friends list. // Game friends list for each (auto player in players) { } } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with KakaoStory and Kakaonot StoryKakaoTalk. } else { // Failed to retrieve KakaoTalk game friends list } }); |
Sending KakaoTalk Game Messages
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // Friend object retrieved via the friends API KakaoGame::Data::KGTKakaoProfile kakaoProfile; // [TODO] Set the template Id std::wstring templateId = TEXT(""); // [TODO] Set the parameters for the message template std::map<std::wstring, std::wstring> arguments; arguments.insert(std::pair<std::wstring, std::wstring>(TEXT("${nickname}"), kakaoProfile.nickname)); arguments.insert(std::pair<std::wstring, std::wstring>(TEXT("rog_link"), TEXT("test=100&hello=20111"))); arguments.insert(std::pair<std::wstring, std::wstring>(TEXT("bruce2"), kTEXT("test=100&hello=20111"))); KakaoGame::Data::KGTResult result; KakaoGame::API::KGTKakaoTalk kakaotalkApi; // Send a KakaoTalk game message kakaotalkApi.sendGameMessage(kakaoProfile, templateId, arguments, result); if (result.isSuccess()) { // Successfully sent KakaoTalk chat message } else if (KakaoGame::Data::KGTResult::MessageSettingDisabled == result.code) { // The recipient has set message reception to "Do Not Disturb"be disabled. } else if (KakaoGame::Data::KGTResult::ExceedDailyUsage == result.code) { // Occurs when the daily quota for sending messages fromto a specific app (regardless of the recipient) is exceeded. } else if (KakaoGame::Data::KGTResult::ExceedMonthlyUsage == result.code) { // Occurs when the monthly quota for sending messages to a specific person fromfor a specific app is exceeded. } else { // Failed to send KakaoTalk chat message } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // Friend object retrieved via the friends API KakaoGame::Data::KGTKakaoProfile kakaoProfile; // [TODO] Set the template Id std::wstring templateId = TEXT(""); // [TODO] Set the parameters for the message template std::map<std::wstring, std::wstring> arguments; arguments.insert(std::pair<std::wstring, std::wstring>(TEXT("${nickname}"), kakaoProfile.nickname)); arguments.insert(std::pair<std::wstring, std::wstring>(TEXT("rog_link"), TEXT("test=100&hello=20111"))); arguments.insert(std::pair<std::wstring, std::wstring>(TEXT("bruce2"), kTEXT("test=100&hello=20111"))); KakaoGame::API::KGTKakaoTalk kakaotalkApi; // Send a KakaoTalk game message kakaotalkApi.sendGameMessage(kakaoProfile, templateId, arguments, [this](KakaoGame::Data::KGTResult result) { if (result.isSuccess()) { // Successfully sent KakaoTalk chat message } else if (KakaoGame::Data::KGTResult::MessageSettingDisabled == result.code) { // The recipient has set message reception to "Dobe Notdisabled. Disturb" } else if (KakaoGame::Data::KGTResult::ExceedDailyUsage == result.code) { // Occurs when the daily quota for sending messages fromto a specific app (regardless of the recipient) is exceeded. } else if (KakaoGame::Data::KGTResult::ExceedMonthlyUsage == result.code) { // Occurs when the monthly quota for sending messages to a specific person fromfor a specific app is exceeded. } else { // Failed to send KakaoTalk chat message } }); |
Adding a KakaoTalk Channel
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // [TODO] Set the channel Id int channelId = 0; KakaoGame::Data::KGTResult result; KakaoGame::API::KGTKakaoTalk kakaotalkApi; kakaotalkApi.addChannel(channelId, result); if (result.isSuccess()) { // Successfully added the channel } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with KakaoStory Kakaoand not StoryKakaoTalk. } else { // Failed to add the channel } |
...
코드 블럭 | ||
---|---|---|
| ||
#include "KakaoGameLib.h" // [TODO] Set the channel Id int channelId = 0; KakaoGame::API::KGTKakaoTalk kakaotalkApi; kakaotalkApi.addChannel(channelId, [this](KakaoGame::Data::KGTResult result, int32_t totalReceiversCount, int32_t joinersCount) { if (result.isSuccess()) { // Successfully added the channel } else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code) { // The logged-in user is not a 'KakaoTalk' user. This occurs when the user is not a KakaoTalk user, such as an account that is only registered with KakaoStory and Kakaonot StoryKakaoTalk. } else { // Failed to add the channel } }); |