70.1 SMS Authentication Example

70.1. SMS Authentication Example

 


70.1.1. Request authentication

This is an example of requesting authentication.

Unity

using KakaoGame.SDK;    // Request authentication KGKakaoProfile.RequestAgeVerification((result) => {     if (result.isSuccess)     {         // Success, this user is a user with age limit or higher.     }     else     {         // Fail         if (result.code == KGResultCode.UnderAgePlayer)         {              // This user is an under age-limited user. Show the message, call logout API and quit your game.         }         else         {              // If personal authentication is mandatory, call this API again.         }     } });

Android

// Request authentication KGKakaoProfile.requestAgeVerification(activity, new KGResultCallback<Void>() {     @Override     public void onResult(KGResult<Void> result) {         if (result.isSuccess()) {             // Success, this user is a user with age limit or higher.         } else {             // Fail             if (result.getCode() == KGResult.KGResultCode.UDER_AGE_PLAYER) {                 // This user is an under age-limited user. Show the message, call logout API and quit your game.             } else {                 // If personal authentication is mandatory, call this API again.             }         }     } });

iOS

#import <KakaoGame/KakaoGame.h>   // Request authentication [KGKakaoProfile requestAgeVerificationWithCompletionHandler:^(NSError *error) {     if (IS_SUCCESS(error))     {         // Success, this user is a user with age limit or higher.     }     else     {         // Fail         if (error.code == KGErrorUnderAgePlayer)         {             // This user is an under age-limited user. Show the message, call logout API and quit your game.         }         else         {              // If personal authentication is mandatory, call this API again.         }     } }];


Windows Sync

Windows Async

Unreal