...
|
Windows Sync
...
코드 블럭 |
---|
#include "KakaoGameLib.h"
// [TODO] Set event Id
int32_t eventId = 511; // Querying this invitation event
KakaoGame::Data::KGResult result;
std::vector<KakaoGame::Data::KGPlayer> invitationSenders;
KakaoGame::API::KGKakaoInvitation kgKakaoInvitation;
// Querying the list of players who invited you
kgKakaoInvitation.loadSenders(eventId, result, invitationSenders);
if (result.isSuccess()) {
// Success
// Get the list of players who invited you
for (KakaoGame::Data::KGPlayer invitationSender : invitationSenders) {
// Get the playerId
std::wstring playerId = player.playerId;
KakaoGame::Data::KGKakaoProfile kakaoProfile = invitationSender.kakaoProfile;
// player's nickname
std::wstring nickname = kakaoProfile.nickname;
// player's KakaoTalk thumbnail image url
std::wstring thumbnailImageUrl = kakaoProfile.thumbnailImageUrl;
}
}
else
{
// Fail...
} |
Windows Async
...
코드 블럭 |
---|
#include "KakaoGameLib.h"
// [TODO] Set event Id
int32_t eventId = 511; // Querying this invitation event
KakaoGame::API::KGKakaoInvitation kgKakaoInvitation;
// Querying the list of players who invited you
kgKakaoInvitation.loadSenders(eventId, [this](KakaoGame::Data::KGResult result, std::vector<KakaoGame::Data::KGPlayer> invitationSenders) {
if (result.isSuccess()) {
// Success
// Get the list of players who invited you
for (KakaoGame::Data::KGPlayer invitationSender : invitationSenders) {
// Get the playerId
std::wstring playerId = player.playerId;
KakaoGame::Data::KGKakaoProfile kakaoProfile = invitationSender.kakaoProfile;
// player's nickname
std::wstring nickname = kakaoProfile.nickname;
// player's KakaoTalk thumbnail image url
std::wstring thumbnailImageUrl = kakaoProfile.thumbnailImageUrl;
}
}
else {
// Fail...
}
}); |
Unreal
...
코드 블럭 |
---|
#include "KakaoGame.h"
// [TODO] Set event Id
int32 eventId = 511; // Querying this invitation event
FKGKakaoInvitation::LoadSenders(eventId, FKGResultWithSendersDelegate::CreateLambda([=](FKGResult result, TArray<FKGPlayer> players) {
if (result.IsSuccess())
{
// Success
// Get the list of players who invited you
for (FKGPlayer player : players)
{
// Get the playerId
FString playerId = player.GetPlayerId();
FKGIdpProfile idpProfile = player.GetIdpProfile();
FKGKakaoProfile *kakaoProfile = (FKGKakaoProfile*)&idpProfile;
// player's nickname
FString nickname = kakaoProfile->GetNickname();
// player's KakaoTalk thumbnail image url
FString thumbnailImageUrl = kakaoProfile->GetThumbnailImageUrl();
}
}
else
{
// Fail
}
})); |