버전 비교

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

...

코드 블럭
#import <KakaoGame/KakaoGame.h>
  
// [TODO] Set event Id
int eventId = 511; // Querying this invitation event
 
// Querying the list of players who invited you
[KGKakaoInvitation loadSendersWithEventId:eventId completionHandler:^(NSError *error, NSArray *invitationSenders) {
    if (IS_SUCCESS(error) == YES)
    {
        // Success
 
        // Get the list of players who invited you
        if (invitationSenders != nil && [invitationSenders count] > 0)
        {
            for (KGPlayer *invitationSender in invitationSenders)
            {
                // Get the playerId
                NSString *playerId = invitationSender.playerId;
 
                KGKakaoProfile *kakaoProfile = (KGKakaoProfile*)invitationSender.idpProfile;
                // player's nickname
                NSString *nickname = kakaoProfile.nickname;
  
                // player's KakaoTalk thumbnail image url
                NSString *thumbnailImageUrl = kakaoProfile.thumbnailImageUrl;
            }
        }
    }
    else if (error.code == KGErrorNotKakaoTalkUser)
    {
        // The user is not a KakaoTalk user.
    }
    else
    {
        // Fail...
    }
}];

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
  }
}));