버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

...

코드 블럭
languagecpp
#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 only registered with KakaoStory and not KakaoTalk.
	}
	else
	{
		// Failed to add the channel
	}
});

...

코드 블럭
languagecpp
#include "KakaoGameLib.h"
// [TODO] Set the event ID
int32 eventId = 0;
KakaoGame::Data::KGTResult result;
std::vector<KakaoGame::Data::KGTPlayer> 

Asynchronous Example

코드 블럭
languagecpp
#include "KakaoGameLib.h"

Retrieve the count of friends to whom I sent an invite message

...

Synchronous Example

코드 블럭
languagecpp
#include "KakaoGameLib.h"

Asynchronous Example

코드 블럭
languagecpp
#include "KakaoGameLib.h"

players;
KakaoGame::API::KGTKakaoInvitation kakaoInvitationApi;

// Retrieve the list of players I invited
kakaoInvitationApi.joiners(eventId, result, players);

if (result.isSuccess())
{
	// Successfully retrieved the list of players I invited
    for (KakaoGame::Data::KGTPlayer player : players)
    {
      // Recipient's player ID
      player.playerId;
      // Recipient's nickname
      player.kakaoProfile.nickname;
      // Recipient's profile thumbnail image
      player.kakaoProfile.thumbnailImageUrl;
      // Check if the recipient has a withdrawal history. Use this flag to display withdrawal information in the UI.
      player.kakaoProfile.isUnregistered;
    }
}
else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code)
{
	// The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user)
}
else
{
	// Failed to retrieve the list
}

Asynchronous Example

코드 블럭
languagecpp
#include "KakaoGameLib.h"
// [TODO] Set the event ID
int32 eventId = 0;
KakaoGame::API::KGTKakaoInvitation kakaoInvitationApi;

// Retrieve the list of players I invited
kakaoInvitationApi.joiners(eventId, [this](KakaoGame::Data::KGTResult result, int32_t totalReceiversCount, int32_t joinersCount) {
	if (result.isSuccess())
	{
		// Successfully retrieved the list of players I invited
		for (KakaoGame::Data::KGTPlayer player : players)
		{
			// Recipient's player ID
			player.playerId;
			// Recipient's nickname
			player.kakaoProfile.nickname;
			// Recipient's profile thumbnail image
			player.kakaoProfile.thumbnailImageUrl;
			// Check if the recipient has a withdrawal history. Use this flag to display withdrawal information in the UI.
			player.kakaoProfile.isUnregistered;
		}
	}
	else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code)
	{
		// The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user)
	}
	else
	{
		// Failed to retrieve the list
	}
});

Retrieve the count of friends to whom I sent an invite message

발췌문 삽입
Kakao Integration Feature SDK Example
Kakao Integration Feature SDK Example
namekakao_invitation_receivers_count
nopaneltrue

Synchronous Example

코드 블럭
languagecpp
#include "KakaoGameLib.h"
// [TODO] Set the event ID
int32 eventId = 0;
KakaoGame::Data::KGTResult result;
int32 totalReceiversCount;
int32 joinersCount;
KakaoGame::API::KGTKakaoInvitation kakaoInvitationApi;

// Retrieve the count of players I invited
kakaoInvitationApi.receiversCount(eventId, result, totalReceiversCount, joinersCount);

if (result.isSuccess())
{
	// Successfully retrieved the counts
    // totalReceiversCount - Total number of friends
    // joinersCount - Number of friends who joined the game
}
else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code)
{
	// The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user)
}
else
{
	// Failed to retrieve the counts
}

Asynchronous Example

코드 블럭
languagecpp
#include "KakaoGameLib.h"
// [TODO] Set the event ID
int32 eventId = 0;
KakaoGame::API::KGTKakaoInvitation kakaoInvitationApi;

// Retrieve the count of players I invited
kakaoInvitationApi.receiversCount(eventId, [this](KakaoGame::Data::KGTResult result, int32_t totalReceiversCount, int32_t joinersCount) {
	if (result.isSuccess())
	{
		// Successfully retrieved the counts
		// totalReceiversCount - Total number of friends
		// joinersCount - Number of friends who joined the game
	}
	else if (KakaoGame::Data::KGTResult::NotKakaoTalkUser == result.code)
	{
		// The logged-in user is not a 'KakaoTalk' user. (For cases where the user is not a KakaoTalk user)
	}
	else
	{
		// Failed to retrieve the counts
	}
});