...
코드 블럭 | ||
---|---|---|
| ||
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
...
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
Unregistering Without Using the Default Unregistration UI
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
코드 블럭 | ||
---|---|---|
| ||
import com.kakaogame.KGTKakaoTalk; // [TODO] Set the channel Id int channelId = 0; KGTKakaoTalk.addChannel(plusFriendId, result -> { if (result.isSuccess()) { // Successfully added the channel } 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 add the channel } }); |
Google Games
...
Retrieve the list of friends to whom I sent an invite message
발췌문 삽입 | |||||||||
---|---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
import com.kakaogame.KGTGoogleGamesAchievementsKGTKakaoInvitation; import com.kakaogame.KGTPlayer; import com.kakaogame.KGTKakaoFriendProfile; // Show[TODO] GoogleEvent GamesId. achievementint informationeventId screen KGTGoogleGamesAchievements.showAchievement(activity); |
Achievement Unlocked
...
코드 블럭 | ||
---|---|---|
| ||
import com.kakaogame.KGTGoogleGamesAchievements= 0; // [TODO]Retrieve Setthe achievementlist IDof Stringfriends idto =whom "";I sent //an Unlockinvite achievementmessage. KGTGoogleGamesAchievementsKGTKakaoInvitation.unlock(id); |
Display Achievement
...
코드 블럭 | ||
---|---|---|
| ||
import com.kakaogame.KGTGoogleGamesAchievements;
// [TODO] Set achievement ID
String id = "";
KGTGoogleGamesAchievements.reveal(id); |
Increase Achievement Level
...
코드 블럭 | ||
---|---|---|
| ||
import com.kakaogame.KGTGoogleGamesAchievements;
// [TODO] Set achievement ID
String id = "";
int numSteps = 0;
KGTGoogleGamesAchievements.setSteps(id, numSteps); |
Set Achievement Level
...
코드 블럭 | ||
---|---|---|
| ||
import com.kakaogame.KGTGoogleGamesAchievements; // [TODO] Set achievement ID String id = ""; int numSteps = 0; KGTGoogleGamesAchievements.increment(id, numStepsjoiners(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
발췌문 삽입 | ||||||||
---|---|---|---|---|---|---|---|---|
|
코드 블럭 | ||
---|---|---|
| ||
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.
}
}); |