버전 비교

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

...

코드 블럭
languagejava
import com.kakaogame.KGTPlayer;
import com.kakaogame.KGTResult;

// Logout request
KGTPlayer.logout(activity, false, result -> {
	if (result.isSuccess()) {
		// Logout successful

		// [TODO] Return to the start screen
	} else {
		// Logout failed
	}
});

Unregistration

...

발췌문 삽입
탈퇴 Unregistration SDK 예제Example탈퇴
Unregistration SDK 예제Example
nameunregister
nopaneltrue

Unregistering Without Using the Default Unregistration UI

발췌문 삽입
탈퇴 Unregistration SDK 예제Example탈퇴
Unregistration SDK 예제Example
nameunregister_custom
nopaneltrue

...

코드 블럭
languagejava
import com.kakaogame.KGTKakaoTalk;

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

...

코드 블럭
languagejava
import com.kakaogame.KGTKakaoTalk;

KGTKakaoInvitation;
import com.kakaogame.KGTPlayer;
import com.kakaogame.KGTKakaoFriendProfile;

// [TODO] Event Id.
int eventId = 0;

// Retrieve the list of friends to whom I sent an invite message.
KGTKakaoInvitation.joiners(eventId, result -> {
    if (result.isSuccess()) {
        // Successfully retrieve the list of friends.

        // Retrieve the list of players I have invited.
        KGTKakaoInvitation.KGTInvitationJoinersResponse joinersResponse = result.getContent();

        // List of players who have joined the app, including those who have left.
        List<KGTPlayer> joiners = joinersResponse.getPlayers();

        if (joiners.isEmpty()) {
            // No users have joined the app.
        } else {
            // There are users who have joined the app.
            for (KGTPlayer player : joiners) {
                // Recipient’s player ID
                String playerId = player.getPlayerId();

                KGTKakaoFriendProfile kakaoProfile = (KGTKakaoFriendProfile) player.getIdpProfile();
                // Recipient’s nickname
                String nickname = kakaoProfile.getNickname();
                // Recipient’s profile thumbnail image
                String thumbnailImageUrl  = kakaoProfile.getThumbnailImageUrl();

                // Recipient’s withdrawal history inquiry. Use the corresponding flag when displaying the withdrawal status information in the UI.
                boolean isUnregistered = kakaoProfile.isUnregistered();
            }
        }
    } else if (result.getCode() == KGTResult.KGTResultCode.NOT_KAKAOTALK_USER) {
        // 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 retrieve the list of friends.
    }
});

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

코드 블럭
languagejava
import com.kakaogame.KGTKakaoInvitation;

// [TODO] Event Id.
int eventId = 0;

KGTKakaoInvitation.receiversCount(eventId, result -> {
    if (result.isSuccess()) {
        // Successfully retrieve the count of friends to whom I sent an invite message.

        // Retrieve the number of friends I have invited.
        KGTInvitationReceviersCountResponse response = result.getContent(); 

        int total = response.getTotalReceiversCount();
        int joinersCount = response.getJoinersCount();
    } else if (result.getCode() == KGTResult.KGTResultCode.NOT_KAKAOTALK_USER) {
        // 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 retrieve the count of friends.
    }
});