21.2. KakaoTalk Invitation Event SDK Example
21.2. KakaoTalk Invitation Event SDK Example
Do not mix with existing APIs under 3.9.0.
21.2.1. Querying ongoing invitation event list
This section shows an example of a query of the ongoing invitation event list.
Unity
using KakaoGame.SDK;
using KakaoGame.SDK.Kakao;
// query of the ongoing invitation event list.
KGKakaoInvitation.LoadEvents((result, events) => {
if (result.isSuccess)
{
// Successful invitation event list lookup
if (events != nil)
{
foreach (KGKakaoEvent invitationEvent in invitationEvents)
{
// Event ID: Required when sending an invitation message, to retrieve a list of invitees or senders.
int eventId = invitationEvent.eventId;
// Event start time
long startTime = invitationEvent.startTime;
// Event end time
long finishTime = invitationEvent.finishTime;
// Event Description
string eventDescription = invitationEvent.eventDescription;
}
}
}
else if (result.code == KGResultCode.NotKakaoTalkUser)
{
// The user is not a KakaoTalk user.
}
else
{
// Fail invitation event list lookup
}
}); |
Android
import com.kakaogame.KGKakaoInvitation;
import com.kakaogame.KGKakaoInvitation.KGKakaoEvent;
import com.kakaogame.KGResult;
// query of the ongoing invitation event list.
KGKakaoInvitation.loadEvents(new KGResultCallback<List<KGKakaoEvent>>() {
@Override
public void onResult(KGResult<List<KGKakaoEvent>> result) {
if (result.isSuccess()) {
// Successful invitation event list lookup
List<KGKakaoEvent> invitationEventList = result.getContent();
for (KGKakaoEvent invitationEvent : invitationEventList) {
// Event ID: Required when sending an invitation message, to retrieve a list of invitees or senders.
int eventId = invitationEvent.getEventId();
// Event start time
long startTime = invitationEvent.getStartTime();
// Event end time
long finishTime = invitationEvent.getFinishTime();
// Event Description
String description = invitationEvent.getEventDescription();
}
} else if (result.getCode() == KGResult.KGResultCode.NOT_KAKAOTALK_USER) {
// The user is not a KakaoTalk user.
} else {
// Fail invitation event list lookup
}
}
}); |
iOS
#import <KakaoGame/KakaoGame.h>
// query of the ongoing invitation event list.
[KGKakaoInvitation loadEventsWithCompletionHandler:^(NSError *error, NSArray *invitationEvents) {
if (IS_SUCCESS(error) == YES)
{
// Successful invitation event list lookup
if (invitationEvents != nil)
{
for (KGKakaoEvent *invitationEvent in invitationEvents)
{
// Event ID: Required when sending an invitation message, to retrieve a list of invitees or senders.
int eventId = invitationEvent.eventId;
// Event start time
long long startTime = invitationEvent.startTime;
// Event end time
long long finishTime = invitationEvent.finishTime;
// Event Description
NSString *eventDescription = invitationEvent.eventDescription;
}
}
}
else if (error.code == KGErrorNotKakaoTalkUser)
{
// The user is not a KakaoTalk user.
}
else
{
// Fail invitation event list lookup
}
}]; |
Windows Sync
Windows Async
Unreal
21.2.2. Querying the number of friends I sent an invitation to
This section shows an example of a query of the count of friends who have received my invitation.
Unity
Android
iOS
Windows Sync
Windows Async
Unreal
21.2.3. Querying the list of friends I sent an invitation to
This section shows an example of a query of the list of friends who have received my invitation.
Unity
Android
iOS
Windows Sync
Windows Async
Unreal
21.2.4. Querying the count of players who invited you
This section shows an example of a query the count of players who invited you.
Unity
Android
iOS
Windows Sync
Windows Async
Unreal
21.2.5. Querying the list of players who invited you
This section shows an example of a query the list of players who invited you.
Unity
Android
iOS
Windows Sync
Windows Async
Unreal