iOS SDK
    • PDF

    iOS SDK

    • PDF

    Article Summary

    Classic/VPC 환경에서 이용 가능합니다.

    iOS용 게임 개발을 위한 GAMEPOT iOS SDK 사용법에 대해 설명합니다. SDK를 설치하고 환경을 구성함으로써 게임과 대시보드를 연동할 수 있습니다.

    요구 사양

    iOS용 GAMEPOT SDK를 사용하기 위한 요구 사양은 다음과 같습니다.

    • 최소 사양: iOS 10.0 이상
    • 개발 환경: Xcode

    SDK 설치 및 환경 구성

    GAMEPOT iOS SDK를 설치한 후 환경을 구성하여 GAMEPOT 대시보드와 게임을 연동하고 게임 개발에 필요한 기능을 사용할 수 있습니다.

    게임팟 SDK에서 지원 언어는 아래와 같습니다.

    • 영어, 이탈리아어,태국어,베트남어,일본어,중국어(간체/번체),인도네시아어,독일어,스페인어,프랑스어,한국어

    앱 실행시 기기 디바이스의 언어에 따라 SDK내 지원언어로 표기되며 미지원언어는 영어로 표기됩니다.
    xcode > localization에 적용하고자 하는 언어 추가를 해야 합니다.

    빌드시 버전 코드는 정수형태로 유니크하게 증가하는 방식으로 진행 부탁드립니다.

    SDK 설치

    GAMEPOT iOS SDK를 설치하고 Xcode에서 프로젝트를 구성하는 방법은 다음과 같습니다.

    1. 관리자 계정으로 대시보드에 로그인해 주십시오.
    2. SDK 다운로드 > iOS 메뉴를 차례대로 클릭한 후 다운로드를 클릭해 주십시오.
    3. Xcode를 실행한 후 게임 프로젝트를 열어 주십시오.
    4. 다운로드한 SDK 파일의 압축을 해제한 후 생성한 프로젝트의 폴더로 드래그 앤 드롭해 주십시오.

    Dependencies 및 Bundle Resource 추가

    SDK를 사용하기 위해 서비스별로 알맞은 Dependencies 및 Bundle Resource를 Xcode에 추가하려면 아래 표를 참조해 주십시오.

    ServiceFrameworkDependenciesBundle Resource
    기본(Base)AFNetworking.framework
    FirebaseAnalytics.framework
    FirebaseCore.framework
    FirebaseCoreDiagnostics.framework
    FirebaseInstanceID.framework
    FirebaseMessaging.framework
    FirebaseNanoPB.framework
    GamePot.framework
    GoogleToolboxForMac.framework
    nanopb.framework
    Protobuf.framework
    libz.tbd WebKit.framework
    UserNotifications.framework
    GamePot.bundle
    로그인(Login)Base
    GamePotChannel.framework

    Google Sign In
    GamePotGoogleSignIn.framework
    GoogleSignIn.framework
    GoogleSignInDependencies.framework

    Facebook
    FBAEMKit.xcframework
    FBSDKCoreKit_Basics.xcframework
    FBSDKCoreKit.xcframework
    FBSDKLoginKit.xcframework
    GamePotFacebook.framework

    LINE
    GamePotLine.framework
    LineSDK.framework
    LineSDKObjC.framework

    NAVER
    GamePotNaver.framework
    NaverThirdPartyLogin.framework

    Google Sign In
    AuthenticationServices.framework
    LocalAuthentication.framework

    Facebook
    SafariServices.framework

    LINE
    SafariServices.framework

    Google Sign In
    GoogleSignIn.bundle
    GameCenterGamePotGameCenter.framework
    AppleIDGamePotApple.framework

    Information Property List 추가 및 설정

    SDK를 사용하기 위해 Information Property List를 Xcode에 추가한 후 설정해야 합니다.

    GAMEPOT iOS SDK는 구글 Firebase를 사용하므로 SDK의 기본 설정값을 포함한 Information Property List뿐만 아니라 Firebase 콘솔에서 획득한 Information Property List를 프로젝트에 함께 추가해야 합니다.

    Information Property List를 추가하고 설정하는 방법은 다음과 같습니다.

    1. 다운로드한 SDK 파일에 포함된 GamePotConfig-Info.plist 파일을 프로젝트에 추가해 주십시오.

      • 해당 파일이 존재하지 않을 경우 동일한 이름으로 파일을 생성한 후 키에 해당하는 값을 입력해 주십시오.
    2. 구글 Firebase 콘솔에서 획득한 GoogleService-Info.plist 파일을 프로젝트에 추가해 주십시오.

    3. Xcode에서 추가한 GamePotConfig-Info.plist에서 아래 설정을 변경해 주십시오.

      • gamepot_project_id: GAMEPOT 프로젝트 ID
      • gamepot_elsa_projectid: (선택) GAMEPOT 로그 프로젝트 ID
    4. Targets > Info > Custom iOS Target Properties 메뉴를 차례대로 클릭한 후 아래 사용자 권한 획득 옵션을 추가해 주십시오.

      • 해당 사용자 권한은 GamePot 고객센터 내의 파일 업로드 기능에서 사용 됩니다.
        NSCameraUsageDescription, NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription

      • iOS 14 버전부터 IDFA 값 획득 시 사용자에게 권한을 획득해야만 IDFA 값 획득이 가능하도록 변경되었습니다. 따라서 IDFA 값 획득 시 사용자에게 권한 획득하는 팝업을 사용하신다면 Targets >> Info >> Custom iOS Target Properties 내에 아래 사용자 권한 획득 옵션을 추가 부탁드립니다. ( 수집하는 목적 및 사용처에 대한 설명이 추가되어야 합니다.)
        NSUserTrackingUsageDescription

    5. 게임팟 대시보드 생성 리전이 싱가포르인 경우에만 다음 설정을 추가해 주십시오.

      • gamepot_region: sg
    6. 게임팟 대시보드 생성 리전이 일본인 경우에만 다음 설정을 추가해 주십시오.

      • gamepot_license_url: https://gamepot.apigw.ntruss.com/fw/jp-v1

    Build Settings 옵션 추가

    SDK를 사용하기 위해 Xcode Build Settings에 -ObjC -lz -lstdc++ -lc++ 옵션을 추가해야 합니다.

    옵션을 추가하려면 Xcode에서 Build Settings > Linking > Other Linker Flags 메뉴를 차례대로 클릭한 후 -ObjC -lz -lstdc++ -lc++옵션을 추가해 주십시오.

    로그인 환경 설정

    계정별 로그인 환경을 설정하려면 Xcode 프로젝트에 알맞은 설정을 추가해야 합니다.

    페이스북 로그인 환경

    Dependencies 추가를 완료하였다면 페이스북 로그인 환경을 설정할 수 있습니다.

    페이스북 로그인 환경을 설정하는 방법은 다음과 같습니다.

    1. Facebook for Developers 콘솔에서 앱 유형을 None 또는 Consumer 또는 Gaming으로 선택한 후 앱을 생성해 주십시오.
    2. Facebook App ID 값을 Xcode의 Info > URL Types 메뉴에 "fb{Facebook App ID}" 형태로 추가해 주십시오(예: fb561593141718906).
    3. Info > iOS Target Property 메뉴를 차례대로 클릭한 후 LSApplicationQueriesSchemes에 아래 설정을 추가해 주십시오.
      • fbapi, fb-messenger-share-api, fbauth2, fbshareextension, fb-messenger-api
    4. GamePotConfig-Info.plist에서 아래 설정을 변경해 주십시오.
      • gamepot_facebook_app_id: Facebook App ID
      • gamepot_facebook_display_name: Facebook display name
      • gamepot_facebook_client_token: 페이스북 콘솔 > 앱 > 설정 > 고급 설정 > 클라이언트 토큰

    구글 Sign In, 라인, 트위터, 네이버, Apple ID 로그인 환경 설정

    Dependencies 및 BundleResource 추가를 완료하였다면 각 계정별 로그인 환경을 설정할 수 있습니다.

    계정별 로그인 환경을 설정하려면 Xcode 프로젝트에 아래 설정을 추가해 주십시오.

    • 구글 Sign In
      • GoogleService-Info.plist 파일의 REVERSED_CLIENT_ID 값을 복사한 후 Xcode에서 Info > URL Types 메뉴를 차례대로 클릭하고 항목을 추가하여 URL Schemes에 입력
      • GamePotConfig-Info.plist에서 아래 설정을 변경
        gamepot_google_app_id: GoogleService-Info.plist 파일의 CLIENT_ID
        gamepot_google_url_schemes: GoogleService-Info.plist 파일의 REVERSED_CLIENT_ID

    • 라인
      • GamePotConfig-Info.plist에서 아래 설정을 변경
        gamepot_line_channelid: Line Channel ID
        gamepot_line_url_schemes: Line URL Scheme (line3rdp.{프로젝트 번들 ID})

      • Info > iOS Target Property 메뉴를 차례대로 클릭한 후 LSApplicationQueriesSchemes에 아래 설정을 추가해 주십시오.
        lineauth2


    • 네이버
      • GamePotConfig-Info.plist에서 아래 설정을 변경
        gamepot_naver_clientid: Naver Client Id
        gamepot_naver_secretid: Naver Secret Id
        gamepot_naver_urlscheme: Naver URL Scheme
      • Info > iOS Target Property 메뉴의 LSApplicationQueriesSchemes에 아래 설정을 추가
        naversearchapp, naversearchthirdlogin, navercafe
      • Info > URL Types 메뉴에 gamepot_naver_urlscheme와 같은 값 추가

    • Apple ID
      • Target을 선택한 후 Signing & Capabilities 메뉴에서 Sign In with Apple Capability 추가

    초기화

    초기화를 수행하려면 AppDelegate 파일에서 아래 코드를 사용해 주십시오.

    #import <GamePot/GamePot.h>
    
    #if __has_include(<AppTrackingTransparency/AppTrackingTransparency.h>)
    #import <AppTrackingTransparency/AppTrackingTransparency.h>
    #endif
    
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        ...
        // GamePot SDK Initialize
        [[GamePot getInstance] setup];
    
        // Push Permission
        if(SYSTEM_VERSION_GRATERTHAN_OR_EQUALTO(@"10.0"))
        {
            UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
            center.delegate = self;
            [center requestAuthorizationWithOptions:(UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionBadge) completionHandler:^(BOOL granted, NSError * _Nullable error){
                if(!error){
                    dispatch_async(dispatch_get_main_queue(), ^{
                        [[UIApplication sharedApplication] registerForRemoteNotifications];
                    });
                }
            }];
        }
        else
        {
            // Code for old versions
            UIUserNotificationType allNotificationTypes = (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
            UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
            [application registerUserNotificationSettings:settings];
            [application registerForRemoteNotifications];
        }
    
    // iOS 14 버전에서 IDFA 값을 가져오기 위한 권한 요청 팝업 호출
    // 프로젝트에 AppTrackingTransparency.framework가 추가되어 있지 않으면 호출되지 않습니다.
    #if __has_include(<AppTrackingTransparency/AppTrackingTransparency.h>)
       if (@available(iOS 14, *)) {
           if(NSClassFromString(@"ATTrackingManager"))
           {
               // 리스너가 등록되어 있지 않을 시 요청 팝업이 발생하지 않습니다.
               [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
    
                   switch (status)
                   {
                       case ATTrackingManagerAuthorizationStatusNotDetermined:
                           break;
                       case ATTrackingManagerAuthorizationStatusRestricted:
                           break;
                       case ATTrackingManagerAuthorizationStatusDenied:
                           break;
                       case ATTrackingManagerAuthorizationStatusAuthorized:
                           break;
                       default:
                           break;
                   }
               }];
           }
       }
    #endif
        ...
    }
    
     // Push
    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
    {
        ...
        [[GamePot getInstance] handleRemoteNotificationsWithDeviceToken:deviceToken];
        ...
    }
    
    - (void)applicationWillEnterForeground:(UIApplication *)application {
        [[GamePotChat getInstance] start];
    }
    
    - (void)applicationDidEnterBackground:(UIApplication *)application {
        [[GamePotChat getInstance] stop];
    }
    

    로그인 관련 기능

    구글, 페이스북, 네이버 등 다양한 로그인 SDK 기능을 통합하여 GAMEPOT iOS SDK에서 사용할 수 있습니다.

    트위터 로그인은 미지원합니다.

    사용 전 설정

    로그인 관련 SDK 기능을 사용하려면 먼저 Appdelegate에 아래 코드를 추가하여 설정을 구성해 주십시오.

    // AppDelegate.m
    #import <GamePotChannel/GamePotChannel.h>
    
    // Google Login 사용 시
    #import <GamePotGoogleSignIn/GamePotGoogleSignIn.h>
    
    // Facebook Login 사용 시
    #import <GamePotFacebook/GamePotFacebook.h>
    
    // AppleID Login 사용 시
    #import <GamePotApple/GamePotApple.h>
    
    // Line Login 사용 시
    #import <GamePotLine/GamePotLine.h>
    
    // Twitter Login 사용 시 - 미지원
    #import <GamePotTwitter/GamePotTwitter.h>
    
    // Naver Login 사용 시
    #import <GamePotNaver/GamePotNaver.h>
    
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
        ...
        // GamePotSDK 채널 초기화. 사용하려는 채널별로 addChannel을 사용해야 하며 Guest 방식은 기본으로 포함됩니다.
        // Google Login 초기화
        GamePotChannelInterface* google     = [[GamePotGoogleSignIn alloc] init];
        [[GamePotChannelManager getInstance] addChannelWithType:GOOGLE interface:google];
    
        // Facebook 로그인 초기화
        GamePotChannelInterface* facebook   = [[GamePotFacebook alloc] init];
        [[GamePotChannelManager getInstance] addChannelWithType:FACEBOOK interface:facebook];
    
        // AppleID 로그인 초기화
        GamePotChannelInterface* apple      = [[GamePotApple alloc] init];
        [[GamePotChannel getInstance] addChannelWithType:APPLE interface:apple];
    
        // Line 로그인 초기화
        GamePotChannelInterface* line = [[GamePotLine alloc] init];
        [[GamePotChannel getInstance] addChannelWithType:LINE interface:line];
    
        // Twitter 로그인 초기화-미지원
        GamePotChannelInterface* twitter = [[GamePotTwitter alloc] init];
        [[GamePotChannel getInstance] addChannelWithType:TWITTER interface:twitter];
    
          // Naver 로그인 초기화
          GamePotChannelInterface* naver = [[GamePotNaver alloc] init];
          [[GamePotChannel getInstance] addChannelWithType:NAVER interface:naver];
    
        // 로그인 처리를 위해 필요합니다.
        [[GamePotChannel getInstance] application:application didFinishLaunchingWithOptions:launchOptions];
    
        ...
    }
    
    - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options
    {
        // 로그인 처리를 위해 필요합니다.
        BOOL nChannelResult = [[GamePotChannel getInstance] application:app openURL:url options:options];
        return nChannelResult;
    }
    

    로그인 기능

    개발사에서 구현한 로그인 UI에 따라 로그인 버튼을 클릭했을 때 동작하는 SDK 로그인 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    // 로그인 타입 정의
    // GamePotChannelType.GOOGLE
    // GamePotChannelType.FACEBOOK
    // GamePotChannelType.GUEST
    // GamePotChannelType.LINE
    // GamePotChannelType.TWITTER-미지원
    // GamePotChannelType.NAVER
    // GamePotChannelType.APPLE
    
    // 구글 로그인 버튼 클릭 시 호출
    [[GamePotChannel getInstance] Login:GOOGLE viewController:self success:^(GamePotUserInfo* userInfo) {
        // 로그인 완료
    } cancel:^{
        // 로그인 시도 중 사용자가 취소
    } fail:^(NSError *error) {
        // 로그인 중 오류 발생
        // TODO: 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
        // TODO: 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
    }];
    

    자동 로그인 기능

    회원이 마지막으로 로그인했던 정보를 전달하는 API를 통한 자동 로그인 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    
    // lastLoginType: 마지막 로그인 값을 가져옵니다.
    GamePotChannelType type = [[GamePotChannel getInstance] lastLoginType];
    
    if(type != NONE)
    {
        // 마지막에 로그인했던 로그인 타입으로 로그인하는 방식입니다.
        // 자동 로그인 처리 시 아래와 같이 호출하면 됩니다.
        [[GamePotChannel getInstance] Login:type viewController:self success:^(GamePotUserInfo* userInfo) {
    
        } cancel:^{
    
        } fail:^(NSError *error) {
            // 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
            // 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
        }];
    }
    else
    {
        // 마지막 로그인된 정보가 없음. 로그인 버튼이 있는 로그인 화면으로 이동
    }
    

    로그아웃 기능

    로그아웃 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    
    [[GamePotChannel getInstance] LogoutWithSuccess:^{
        // 로그아웃 완료 후 초기 화면으로 이동합니다.
    } fail:^(NSError *error) {
        // 로그아웃 실패. 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
        // 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
    }];
    
    

    회원 탈퇴 기능

    회원 탈퇴 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    
    [[GamePotChannel getInstance] DeleteMemberWithSuccess:^{
        // 회원 탈퇴 성공. 로그인 화면으로 이동합니다.
    } fail:^(NSError *error) {
        // 회원 탈퇴 실패. 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
        // 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
    }];
    

    로그인 검증 기능

    로그인 완료 후 로그인 정보를 개발사 서버에서 GAMEPOT 서버로 전달하여 로그인 검증을 진행할 수 있습니다.

    자세한 설명은 로그인 검증 요청을 참조해 주십시오.

    외부 계정 연동

    하나의 게임 계정에 여러 개의 외부 계정을 연결 또는 연결 해제할 수 있습니다.

    계정 연동 기능

    구글, 페이스북, 네이버 등 다양한 외부 계정과의 연동 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    
    // 타입 정의
    // GamePotChannelType.GOOGLE
    // GamePotChannelType.FACEBOOK
    // GamePotChannelType.LINE
    // GamePotChannelType.TWITTER
    // GamePotChannelType.NAVER
    // GamePotChannelType.APPLE
    
    [[GamePotChannel getInstance] CreateLinking:GOOGLE viewController:self success:^(GamePotUserInfo *userInfo) {
        // 연동 완료. 게임 팝업으로 연동 결과에 대한 메시지를 표시해 주십시오(예: 계정 연동에 성공했습니다).
    } cancel:^{
        // 사용자가 취소
    } fail:^(NSError *error) {
        // 연동 실패. 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
        // 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
    }];
    
    

    연동 리스트 확인 기능

    계정에 연동된 외부 계정 목록을 확인하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    
    // 타입 정의
    // GamePotChannelType.GOOGLE
    // GamePotChannelType.FACEBOOK
    // GamePotChannelType.LINE
    // GamePotChannelType.TWITTER
    // GamePotChannelType.NAVER
    // GamePotChannelType.APPLE
    
    // 타입에 따른 연동 결과를 리턴합니다.
    BOOL isGoogleLinked = [[GamePotChannel getInstance] isLinked:GOOGLE];
    
    // 연동되어 있는 타입에 대해 JsonString 형태로 리턴합니다.
    NSString* linkedList = [[GamePotChannel getInstance] getLinkedListJsonString];
    
    

    연동 해제 기능

    외부 계정과의 연동 해제 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePotChannel/GamePotChannel.h>
    
    [[GamePotChannel getInstance] DeleteLinking:GOOGLE success:^{
         // 해제 완료. 게임 팝업으로 연동 결과에 대한 메시지를 표시해 주십시오(예: 계정 연동을 해제했습니다).
    } fail:^(NSError *error) {
         // 해제 실패. 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
         // 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
    }];
    

    결제 기능

    인앱 구매를 위한 결제 기능을 사용할 수 있습니다. 결제의 결과 값은 Delegate 형태로 구현됩니다.

    AppDelegate 설정

    결제 기능을 사용하기 위해 AppDelegate를 설정하려면 아래 코드를 사용해 주십시오.

    #import <GamePot/GamePot.h>
    
    @interface ViewController () <GamePotPurchaseDelegate>
    @end
    @implementation ViewController
    
    - (void)viewDidLoad
    {
        ...
        [[GamePot getInstance] setPurchaseDelegate:self];
        ...
    }
    
    - (void)GamePotPurchaseSuccess:(GamePotPurchaseInfo *)_info
    {
        // 결제 성공
    }
    
    - (void)GamePotPurchaseFail:(NSError *)_error
    {
        // 결제 오류. 게임 팝업으로 실패 원인에 대한 메시지를 표시해 주십시오.
        // 메시지 문구는 [error localizedDescription]를 사용해 주십시오.
    }
    
    - (void)GamePotPurchaseCancel
    {
        // 결제 시동 중 취소
        // '결제가 취소되었습니다.' 메시지를 게임 팝업으로 표시합니다.
    }
    @end
    

    결제 시도 기능

    결제 시도 기능을 사용하려면 아래의 코드를 사용해 주십시오.

    • 일반 결제 시도
    #import <GamePot/GamePot.h>
    
    // productid : 스토어에 등록된 상품 ID를 입력
    [[GamePot getInstance] purchase:productid];
    
    


    • 결제 시도 및 영수증 번호를 별도로 관리
    #import <GamePot/GamePot.h>
    
    // productId : 스토어에 등록된 상품 ID를 입력
    // uniqueId  : 별도로 관리하는 영수증 번호를 입력
    [[GamePot getInstance] purchase:productid uniqueId:uniqueid];
    


    • 결제 시도, 영수증 번호를 별도로 관리, 캐릭터 정보를 웹훅으로 전달
    #import <GamePot/GamePot.h>
    
    // productId : 스토어에 등록된 상품 ID
    // uniqueId  : 별도로 관리하는 영수증 번호
    // serverId  : 결제를 진행한 캐릭터의 서버 ID
    // playerId  : 결제를 진행한 캐릭터의 캐릭터 ID
    // etc       : 결제를 진행한 캐릭터의 기타 정보
    [[GamePot getInstance] purchase:productid uniqueId:uniqueid serverId:serverid playerId:playerid etc:etc]];
    

    결제 아이템 리스트 획득 기능

    스토어에서 전달하는 인앱 결제 아이템 리스트를 획득하는 기능을 사용하려면 아래 코드를 사용해 주십시오.

    [case1]
    NSArray<SKProduct*>* itemList = [[GamePot getInstance] getDetails];
    
    // 디바이스 통화 설정에 따른 가격을 읽어오려는 경우
    [[GamePot getInstance] getLocalizePrice:[product productIdentifier]];
    
    [case2]
    
    [[GamePot getInstance] getPurchaseItemsJsonString];
    
    
    [case3]
    
    @try{
        [[GamePot getInstance] getPurchaseDetailListAsyncToJSON:^(BOOL _success, NSString *_items, NSError *_error)
        {
            if(_success)
            {
                if(_items)
                {
                    // In-app information
                }
            }else
            {
                if(_error){
                    // NSLog(@"Error = %@", [_error localizedDescription]);
                }
            }
        }];
    }
    @catch(NSException* ex){
        NSLog(@"Error : %@", ex);
    }
    
    

    결제 아이템 지급 기능

    결제 스토어의 영수증 내역과 대조하여 검증을 모두 완료한 경우에만 개발사 서버에 지급 요청을 전송하도록 설정할 수 있습니다.

    자세한 설명은 아이템 지급 요청를 참조해 주십시오.

    SDK 자체 제공 로그인 UI

    GAMEPOT iOS SDK가 제공하는 완성된 형태의 로그인 UI를 사용할 수 있습니다.

    AppDelegate 설정

    자체 제공 로그인 UI를 사용하기 위해 AppDelegate를 설정하려면 아래 코드를 사용해 주십시오.

    #import <GamePot/GamePot.h>
    #import <GamePotChannel/GamePotChannel.h>
    
    NSArray* order = @[@(GOOGLE), @(FACEBOOK), @(APPLE),@(NAVER), @(LINE), @(TWITTER), @(GUEST)];
    GamePotChannelLoginOption* options = [[GamePotChannelLoginOption alloc] init:order];
    [option setShowLogo:YES];
    
    [[GamePotChannel getInstance] showLoginWithUI:self option:options success:^(GamePotUserInfo *userInfo) {
        // 로그인 완료. 게임 로직에 맞게 처리해 주십시오.
                
    } update:^(GamePotAppStatus *appStatus) {
            // 강제 업데이트 필요. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
            // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
            [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
             setCloseHandler:^{
                // showAppStatusPopup API를 호출한 경우 앱을 종료해야 하는 상황에 호출됩니다.
                // 종료 프로세스를 처리해 주십시오.
            } setNextHandler:^(NSObject* resultPayload) {
                // 대시보드 업데이트 설정에서 권장 설정 시 "다음에 하기" 버튼이 표시됩니다.
                // 해당 버튼을 사용자가 선택하면 호출됩니다.
                // resultPayload 정보를 이용하여 로그인 완료 시와 동일하게 처리해 주십시오.
                // GamePotUserInfo* userInfo = (GamePotUserInfo*)resultPayload;
    
            }];
        } maintenance:^(GamePotAppStatus *appStatus) {
              // 점검 중. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
            // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
            [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
             setCloseHandler:^{
                // showAppStatusPopup API를 호출한 경우 앱을 종료해야 하는 상황에 호출됩니다.
                // 종료 프로세스를 처리해 주십시오.
            }];
        } exit:^{
        // X 버튼 클릭시 처리
    }];
    

    자체 제공 로그인 UI 이미지 로고 설정

    자체 제공 로그인 UI 상단에 표시되는 이미지를 설정할 수 있습니다. 별도로 설정하지 않으면 SDK에 포함된 기본 이미지를 사용하며, 게임에 맞는 이미지를 직접 설정할 수 있습니다. 권장 이미지 크기는 310x220입니다.

    자체 제공 로그인 UI 이미지를 설정하려면 설정할 이미지의 파일명을 ic_stat_gamepot_login_logo.png로 변경한 후 GamePot.bundle 내에 존재하는 같은 이름의 기존 파일과 교체해 주십시오.

    쿠폰 기능

    사용자가 쿠폰을 입력하면 사용 처리하는 기능을 사용하려면 아래 코드를 사용해 주십시오.

    #import <GamePot/GamePot.h>
    
    [[GamePot getInstance] coupon:/*사용자에게 입력받은 쿠폰*/ handler:^(BOOL _success, NSError *_error) {
        if(_success)
        {
            // message에 쿠폰 사용에 대한 결과가 리턴됩니다. 게임 팝업에 이 메시지를 표시해 주십시오.
        }
        else
        {
            // _error에 쿠폰 사용 실패 원인에 대한 정보가 리턴됩니다.
            // [_error localizedDescription]의 내용을 게임 팝업으로 표시해 주십시오.
        }
    }];
    

    아이템 지급

    쿠폰 사용에 성공하면 개발사 서버에 아이템 지급을 요청합니다.

    자세한 설명은 아이템 지급 요청을 참조해 주십시오.

    푸시 기능

    일반 푸시, 야간 푸시, 광고성 푸시 기능을 활성화 또는 비활성화하고, 로컬 푸시 기능을 사용할 수 있습니다.
    광고성 푸시 설정은 푸시기능을 사용하신다면 YES로 해주세요 (광고성 푸시 값이 NO 인 경우 일반/야간 푸시 설정 상관없이 푸시가 오지 않습니다.)

    푸시 활성화 및 비활성화

    푸시 기능을 사용하려면 아래의 코드를 사용해 주십시오.

    #import <GamePot/GamePot.h>
    
    // 푸시 수신 On/Off
    [[GamePot getInstance] setPushEnable:YES success:^{
    
    } fail:^(NSError *error) {
    
    }];
    
    // 야간 푸시 수신 On/Off
    [[GamePot getInstance] setNightPushEnable:YES success:^{
    
    } fail:^(NSError *error) {
    
    }];
    
    // 푸시/야간 푸시를 한번에 설정
    // 로그인 전에 푸시/야간 푸시 허용 여부를 획득하는 게임이라면 로그인 후에 아래 코드를 반드시 호출해 주십시오.
    [[GamePot getInstance] setPushStatus:YES night:YES ad:YES success:^{
        <#code#>
    } fail:^(NSError *error) {
        <#code#>
    }];
    

    이미지 푸시 기능

    iOS 앱에서 알림 이미지를 수신하고 처리할 수 있도록 알림 서비스 확장 프로그램을 추가하는 방법은 다음과 같습니다.

    1. Xcode에서 Target 메뉴를 클릭한 후 Notification Service Extension을 선택하고 Next를 클릭해 주십시오.
    2. Project Name을 입력한 후 Finish를 클릭해 주십시오.
    3. 생성된 Notification Service Extension 모듈의 NotificationService.h 파일을 아래와 같이 수정해 주십시오.
      // GamePot/GamePotNotificationServiceExtension.h를 Import
      // #import <UserNotifications/UserNotifications.h>
      #import <GamePot/GamePotNotificationServiceExtension.h>
      
      // UNNotificationServiceExtension 대신 GamePotNotificationServiceExtension를 상속
      // @interface NotificationService : UNNotificationServiceExtension
      @interface NotificationService : GamePotNotificationServiceExtension
      @end
      
    4. 생성된 Notification Service Extension 모듈의 NotificationService.m 파일을 아래와 같이 수정해 주십시오.
      ...
      - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
          // self.contentHandler = contentHandler;
          // self.bestAttemptContent = [request.content mutableCopy];
      
          // Modify the notification content here...
          // self.bestAttemptContent.title = [NSString stringWithFormat:@"%@ [modified]", self.bestAttemptContent.title];
      
          // self.contentHandler(self.bestAttemptContent);
          [super didReceiveNotificationRequest:request withContentHandler:contentHandler];
      }
      ...
      
    5. 생성된 Notification Service Extension 모듈에서 Targets > Build Phases > Link Binary With Libraries 메뉴를 차례대로 클릭한 후 GamePot.framework를 추가해 주십시오.

    로컬 푸시 기능

    푸시 메시지 서버를 통하지 않고 디바이스에서 자체적으로 푸시를 표시할 수 있습니다.

    푸시를 등록하여 정해진 시간에 로컬 푸시가 표시되도록 하려면 아래 코드를 사용해 주십시오.

     NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
     [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    
     NSString* strDate = [formatter stringFromDate:[[NSDate date] dateByAddingTimeInterval:30]];
    
     int pushId  = [[GamePot getInstance] sendLocalPush:@"Title" setMessage:@"Message" setDateString:strDate];
    /* pushid의 return 값은 개발사에서 관리 */
    

    등록한 로컬 푸시 취소

    로컬 푸시를 등록할 때 얻은 pushid 값을 사용하여 기존에 등록된 푸시를 취소하려면 아래 코드를 사용해 주십시오.

    [[GamePot getInstance] cancelLocalPush:(int)pushId];
    

    공지사항 이미지 표시 기능

    대시보드의 공지사항 메뉴에 업로드한 이미지가 표시되도록 설정할 수 있습니다. 권장 이미지 크기는 아래와 같습니다.

    • 크기: 720x1200(Portrait), 1280x640(Landscape)
    • 용량: 250 kB 이하

    대시보드 공지사항 메뉴에 업로드한 이미지가 표시되도록 하려면 아래 코드를 사용해 주십시오.

    [[GamePot getInstance] showNotice:/*viewController*/ setSchemeHandler:^(NSString *scheme) {
        NSLog(@"scheme = %@", scheme);
    }];
    

    특정한 분류의 공지사항 이미지만 표시

    특정한 분류의 공지사항 이미지만 표시되도록 하려면 아래 코드를 사용해 주십시오.

    [[GamePot getInstance] showEvent:/*viewController*/ setType:/*Type*/ setSchemeHandler:^(NSString *scheme) {
        NSLog(@"scheme = %@", scheme);
    }];
    

    고객지원 기능

    대시보드와 연동하여 고객 문의, 정책 및 약관 UI 호출, 동의 수집 등의 기능을 사용할 수 있습니다.

    고객 문의 기능

    회원이 문의를 발송하고 담당자가 답변할 수 있는 고객 문의 기능을 사용할 수 있습니다. 대시보드의 고객지원 > 고객문의 메뉴와 연동됩니다.

    고객 문의 UI는 디바이스 언어에 따라 한국어, 영어, 일어, 중국어 간체 및 번체 중 하나의 언어로 변경되며, 이외의 디바이스 언어일 경우 영어로 변경됩니다.

    대시보드와 연동하여 고객 문의 기능을 사용하려면 아래 코드를 사용해 주십시오.

    [[GamePot getInstance] showHelpWebView:(UIViewController *)];
    

    외부 링크 고객 문의

    외부 링크를 통해 로그인하지 않은 고객도 문의를 등록할 수 있도록 하려면 아래 코드를 사용해 주십시오.

    // showWebView Type
        // WEBVIEW_NORMAL // 뒤로가기 버튼 없음
        // WEBVIEW_NORMALWITHBACK // 뒤로가기 버튼 있음
    
        [[GamePot getInstance] showWebView:/*현재 ViewController*/ setType:/*Type*/ setURL:/*외부문의 접속 URL*/];
    

    약관 및 정책 UI 호출 기능

    대시보드의 고객지원 메뉴에서 작성한 각종 약관, 정책을 UI로 호출할 수 있습니다.

    약관 및 정책 UI를 호출하려면 아래 코드를 사용해 주십시오.

    • 이용약관

      #import <GamePot/GamePot.h>
      
      [[GamePot getInstance] showTerms:/*ViewController*/];
      
    • 개인정보처리방침

      #import <GamePot/GamePot.h>
      
      [[GamePot getInstance] showPrivacy:/*ViewController*/];
      
    • 환불정책

      #import <GamePot/GamePot.h>
      
      [[GamePot getInstance] showRefund:/*ViewController*/];
      

    약관 동의 기능 (GDPR 포함)

    제공되는 팝업 UI 기능을 사용하여 대시보드에서 작성한 각종 정책과 약관에 대한 동의를 수집할 수 있습니다. GDPR 정책에 대한 동의도 수집 가능합니다.

    약관 동의 자동 호출

    GAMEPOT iOS SDK 버전 v3.3.0 이상을 사용하는 경우 회원이 로그인할 때 자동으로 약관 동의 팝업이 표시됩니다.

    로그인할 때의 약관 동의 자동 호출 여부를 변경하려면 하려면 아래 코드를 사용해 주십시오.

    // Default Value는 YES
    // 자동 팝업 시 MATERIAL_BLUE 테마로 적용
    // false로 설정 시 로그인 할 때 약관 동의 팝업이 표시되지 않습니다.
    [[GamePot getInstance] setAutoAgree:YES];
    
    // MATERIAL_ORANGE 테마로 커스텀 적용 시
    GamePotAgreeOption* options = [[GamePotAgreeOption alloc] init:MATERIAL_ORANGE];
    [[GamePot getInstance] setAgreeBuilder:options];
    
    ...
    
    [[GamePotChannel getInstance] Login:GamePotChannelType viewController:self success:^(GamePotUserInfo* userInfo) {
    
    } cancel:^{
    
    } fail:^(NSError *error) {
    
    } update:^(GamePotAppStatus *appStatus) {
    
    } maintenance:^(GamePotAppStatus *appStatus) {
    
    }];
    
    ...
    

    수동 약관 동의 호출

    약관 동의 호출을 수동으로 수행하려면 아래 코드를 사용해 주십시오.

    • 테마 선택

      // 기본 테마
      [[GamePotAgreeOption alloc] init:BLUE];
      [[GamePotAgreeOption alloc] init:GREEN];
      
      // 개선테마  
      //  [[GamePotAgreeOption alloc] init:MATERIAL_RED];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_BLUE];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_CYAN];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_ORANGE];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_PURPLE];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_DARKBLUE];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_YELLOW];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_GRAPE];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_GRAY];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_GREEN];
      //  [[GamePotAgreeOption alloc] init:MATERIAL_PEACH];
      
    • 호출

      GamePotAgreeOption* option = [[GamePotAgreeOption alloc] init:MATERIAL_BLUE];
      [[GamePot getInstance] showAgreeView:self option:option handler:^(GamePotAgreeInfo *result) {
         // [result agree] : 필수 약관을 모두 동의한 경우 true
         // [result agreePush] : 일반 광고성 수신 동의를 체크한 경우 true, 그렇지 않으면 false
         // [result agreeNight] : 야간 광고성 수신 동의를 체크한 경우 true, 그렇지 않으면 false
         // agreePush / agreeNight 값은 로그인 완료 후 setPushEnable api를 통해 한번에 설정해주십시오.
      }];
      

    약관 동의 UI 테마 직접 구성

    SDK에서 제공하는 테마를 사용하는 대신 직접 구성한 약관 동의 UI 테마를 사용할 수 있습니다.

    약관 동의 UI 테마를 직접 구성하여 사용하려면 약관 동의를 호출하기 전에 아래 코드를 사용하여 테마를 구성해 주십시오.

    • 약관 자동 호출 시 팝업 Customizing 설정
    GamePotAgreeOption* options = [[GamePotAgreeOption alloc] init:MATERIAL_BLUE];
    
    [[GamePot getInstance] setAgreeBuilder:options];
    
    • 세부 설정
    GamePotAgreeOption* option = [[GamePotAgreeOption alloc] init:MATERIAL_BLUE];
    
    [option setHeaderBackGradient:@[@0xFF00050B,@0xFF0F1B21]];
    [option setHeaderTitleColor:0xFF042941];
    [option setContentBackGradient:@[@0xFF112432,@0xFF112432]];
    [option setContentIconColor:0xFF042941];
    [option setContentCheckColor:0xFF91adb5];
    [option setContentTitleColor:0xFF98b3c6];
    [option setContentShowColor:0xFF98b3c6];
    [option setFooterBackGradient:@[@0xFF112432,@0xFF112432]];
    [option setFooterButtonGradient:@[@0xFF1E3A57,@0xFF57B2E2]];
    [option setFooterButtonOutlineColor:0xFF0b171a];
    [option setFooterTitleColor:0xFFFFFFD5];
    
    // 문구 변경
    [option setAllMessage:@"모두 동의"];
    [option setTermMessage:@"필수) 이용약관"];
    [option setPrivacyMessage:@"필수) 개인정보 취급 방침"];
    [option setPushMessage:@"선택) 일반 푸시 수신 동의"];
    [option setNightPushMessage:@"선택) 야간 푸시 수신 동의"];
    [option setFooterTitle:@"게임 시작하기"];
    
    // 광고성 수신 동의(일반/야간) 체크 후 게임 시작 시 Toast 메시지(동의 시간) 표시 여부
    [option setShowToastPushStatus:YES];
    
    // 광고성 수신 동의(일반/야간) 메시지 수정
    [option setPushToastMsg:@"Push on"];
    [option setNightPushToastMsg:@"Night Push on"];
    // 미사용시 @""로 설정
    [option setHeaderTitle:@"약관 동의"];
    
    // 일반 광고성 수신 동의 버튼 표시 여부
    [option setShowPush:YES];
    
    // 야간 광고성 수신 동의 버튼 표시 여부
    [option setShowNightPush:YES];
    
    // 일반 광고성 수신 동의 링크 설정 (미사용 시 설정하지 않음)
    [option setPushDetailURL:@"https://..."];
    
    // 야간 광고성 수신 동의 링크 설정 (미사용 시 설정하지 않음)
    [option setNightPushDetailURL:@"https://..."];
    
    
      [[GamePot getInstance] showAgreeView:self option:option handler:^(GamePotAgreeInfo *result) {
           .......
      }];
    
    
    • 각 변수는 아래 이미지에 표시된 영역에 적용됩니다.
      • AgeView
        gamepot_android_09_ko1
      • EmailView
        gamepot_android_09_1_ko
      • AgreeView
        gamepot_android_09_2_ko

    GDPR 약관 체크리스트 기능

    대시보드에서 활성화한 GDPR 약관 항목을 리스트 형태로 가져오려면 아래 코드를 사용해 주십시오.

    (NSArray*) [[GamePot getInstance] getGDPRCheckedList];
    
    //리턴되는 각 파라미터는 대시보드의 다음 설정에 해당합니다.
    gdpr_privacy : 개인정보취급방침
    gdpr_term : 이용약관
    gdpr_gdpr : GDPR 이용약관
    gdpr_push_normal : 이벤트 푸시 수신동의
    gdpr_push_night : 야간 이벤트 푸시 수신동의 (한국만 해당)
    gdpr_adapp_custom : 개인 맞춤광고 보기에 대한 동의 (GDPR 적용 국가)
    gdpr_adapp_nocustom : 개인 맞춤이 아닌 광고 보기에 대한 동의 (GDPR 적용 국가)
    

    점검 및 강제 업데이트 기능

    게임 점검 및 강제 업데이트 기능을 사용할 수 있습니다. 대시보드의 점검 & 업데이트 메뉴에서 각 기능을 활성화하면 동작합니다.

    점검 및 강제 업데이트 기능을 사용하려면 아래 코드를 사용해 주십시오.

    [[GamePotChannel getInstance] Login:GAMECENTER viewController:self
        success:^(GamePotUserInfo* userInfo) {
                // 로그인 완료. 게임 로직에 맞게 처리해 주십시오.
        } cancel:^{
                // 사용자가 로그인을 취소
        } fail:^(NSError *error) {
                // 로그인 실패. [error localizedDescription]를 이용해서 오류 메시지를 표시해 주십시오.
        } update:^(GamePotAppStatus *appStatus) {
            // 강제 업데이트 필요. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
            // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
            [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
             setCloseHandler:^{
                // showAppStatusPopup API를 호출한 경우 앱을 종료해야 하는 상황에 호출됩니다.
                // 종료 프로세스를 처리해 주십시오.
            } setNextHandler:^(NSObject* resultPayload) {
                // 대시보드 업데이트 설정에서 권장 설정 시 "다음에 하기" 버튼이 표시됩니다.
                // 해당 버튼을 사용자가 선택하면 호출됩니다.
                // resultPayload 정보를 이용하여 로그인 완료 시와 동일하게 처리해 주십시오.
                // GamePotUserInfo* userInfo = (GamePotUserInfo*)resultPayload;
    
            }];
        } maintenance:^(GamePotAppStatus *appStatus) {
              // 점검 중. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
              // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
            [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
             setCloseHandler:^{
                // TODO: showAppStatusPopup API를 호출한 앱을 종료해야 하는 상황에 호출됩니다.
                // TODO: 종료 프로세스를 처리해 주십시오.
            }];
        }];
    

    원격 구성 기능

    대시보드의 게임 > 원격구성메뉴에 등록한 서버 매개변수 값을 가져올 수 있습니다. 매개변수 값을 가져와 SDK에서 사용하면 게임을 업데이트하지 않고 각 요소를 수정 및 제어할 수 있습니다.

    가져온 매개변수는 로그인 시점에 로드되며, 그 이후부터 호출할 수 있습니다.

    원격 구성 기능을 사용하려면 아래 코드를 사용하세요.

    #import <GamePot/GamePot.h>
    
    //key : 매개변수 string
    NSString *str_value = [[GamePot getInstance] getConfig:(NSString*)key];
    
    //대시보드에 추가한 모든 매개변수를 json 형태로 가져옵니다.
    NSArray *json_value = [[GamePot getInstance] getConfigs];
    

    게임 로그 전송 기능

    게임 로그를 호출하여 대시보드의 게임 > 플레이어 메뉴에서 확인할 수 있습니다.

    게임 로그 전송 기능을 사용하려면 표를 참조하여 아래 코드에 예약어를 입력한 후 코드를 호출해 주십시오.

    • 예약어 및 코드
      예약어필수 여부타입설명최대 길이
      GamePotSendLogCharacter.NAME필수String캐릭터명128
      GamePotSendLogCharacter.LEVEL선택String레벨128
      GamePotSendLogCharacter.SERVER_ID선택String서버 ID128
      GamePotSendLogCharacter.PLAYER_ID선택String캐릭터 ID128
      GamePotSendLogCharacter.USERDATA선택StringETC128
      #import <GamePot/GamePotSendLog.h>
      #import <GamePot/GamePotSendLogCharacter.h>
      
      GamePotSendLogCharacter* info = [[GamePotSendLogCharacter alloc] init];
      
      [info put:@"name" forKey:GAMEPOT_NAME];
      [info put:@"playerid" forKey:GAMEPOT_PLAYER_ID];
      [info put:@"serverid" forKey:GAMEPOT_SERVER_ID];
      [info put:@"level" forKey:GAMEPOT_LEVEL];
      [info put:@"userdata" forKey:GAMEPOT_USERDATA];
      
      BOOL result = [GamePotSendLog characterInfo:info];
      
      // 결과값 true : 검증 성공. 로그가 GAMEPOT 서버로 전송됩니다.
      // 결과값 false : 검증 실패. logcat을 확인해 주십시오.
      

    AppStatus 확인

    현재 클라이언트의 AppStatus를 확인하려면 아래 코드를 사용해 주십시오. ( 로그인 전 점검 / 업데이트 상태 확인 )

    #import <GamePot/GamePot.h>
    
    [[GamePot getInstance] checkAppStatus:^{
        
        //Login Success
    
    } setFailHandler:^(NSError *error) {
    
        //Failed
    
    } setUpdateHandler:^(GamePotAppStatus *status) {
    
        //NeedUpdate
         // 강제 업데이트 필요. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
        // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
        [[GamePot getInstance] showAppStatusPopup:self setAppStatus:status
         setCloseHandler:^{
            // showAppStatusPopup API를 호출한 경우 앱을 종료해야 하는 상황에 호출됩니다.
            // 종료 프로세스를 처리해 주십시오.
        } setNextHandler:^(NSObject* resultPayload) {
            // 대시보드 업데이트 설정에서 권장 설정 시 "다음에 하기" 버튼이 표시됩니다.
            // 해당 버튼을 사용자가 선택하면 호출됩니다.
            // resultPayload 정보를 이용하여 로그인 완료 시와 동일하게 처리해 주십시오.
            // GamePotUserInfo* userInfo = (GamePotUserInfo*)resultPayload;
    
        }];
    
    } setMaintenanceHandler:^(GamePotAppStatus *status) {
    
        //OnMaintenance
        // 점검 중. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
          // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
        [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
         setCloseHandler:^{
            // TODO: showAppStatusPopup API를 호출한 앱을 종료해야 하는 상황에 호출됩니다.
            // TODO: 종료 프로세스를 처리해 주십시오.
        }];
    
    }];
    

    setUserData설정

    로그인 후 해당 회원에 추가 정보를 넣고자 할때 사용해주세요.
    key 최대 갯수 50개 제한
    value 최대 길이 1024 제한
    해당 정보는 회원 상세 항목에서만 확인이 가능합니다.

    #import <GamePot/GamePot.h>
    
    NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:
                            @"1.0.23",@"appversion",
                            @"s1",@"server"];
                            
    [[GamePot getInstance] setUserData:dict handler:^(BOOL _success, NSError *_error) {
        if(_success)
        {
            //setUserData 성공
        }
        else
        {
             //setUserData 실패
        }
    }];
    

    3rd Party SDK 연동

    GAMEPOT iOS SDK는 3rd Party SDK와의 연동을 지원합니다.

    3rd Party SDK 로그인 연동

    3rd Party SDK와 연동하여 로그인 기능을 사용하려면 표를 참조하여 아래 코드에 파라미터에 값을 입력한 후 코드를 사용해 주십시오.

    • 파라미터 및 코드
      파라미터명필수 여부타입설명
      viewController필수UIViewController현재 ViewController
      userid필수NSString사용자 고유 ID
      success필수String성공시 콜백
      fail필수String실패시 콜백
      update선택String업데이트 기능 동작시 콜백
      maintenance선택String점검 기능 동작시 콜백
      NSString userid = @"memberid of 3rd party sdk";
      
      [[GamePotChannel getInstance] loginByThirdPartySDK:self uId:userid success:^(GamePotUserInfo* userInfo) {
          // 로그인 완료. 게임 로직에 맞게 처리해 주십시오.
      } cancel:^{
          // 사용자가 로그인을 취소
      } fail:^(NSError *error) {
          // 로그인 실패. [error localizedDescription]를 이용해서 오류 메시지를 표시해 주십시오.
      } update:^(GamePotAppStatus *appStatus) {
          // 강제 업데이트 필요. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
          // Customizing을 하고자 하는 경우 아래 API를 호출하지 않은 상태에서 Customizing을 수행해 주십시오.
          [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
              setCloseHandler:^{
              // showAppStatusPopup API를 호출한 경우 앱을 종료해야 하는 상황에 호출됩니다.
              // 종료 프로세스를 처리해 주십시오.
          } setNextHandler:^(NSObject* resultPayload) {
              // Dashboard 업데이트 설정에서 권장 설정 시 "다음에 하기" 버튼이 표시됩니다.
              // 해당 버튼을 사용자가 선택하면 호출됩니다.
              // resultPayload 정보를 이용하여 로그인 완료 시와 동일하게 처리해 주십시오.
              // GamePotUserInfo* userInfo = (GamePotUserInfo*)resultPayload;
      
          }];
      } maintenance:^(GamePotAppStatus *appStatus) {
          // 점검 중. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
          // 점검 중. 아래 API를 호출하면 SDK 자체 팝업을 표시할 수 있습니다.
          [[GamePot getInstance] showAppStatusPopup:self setAppStatus:appStatus
              setCloseHandler:^{
              // showAppStatusPopup API를 호출한 경우 앱을 종료해야 하는 상황에 호출됩니다.
              // 종료 프로세스를 처리해 주십시오.
          }];
      }];
      

    3rd Party SDK 결제 연동

    3rd Party SDK와 연동하여 결제 기능을 사용하려면 표를 참조하여 아래 코드에 파라미터에 값을 입력한 후 코드를 사용해 주십시오.

    • 파라미터 및 코드
      파라미터명필수 여부타입설명
      productid필수NSString대시보드에 등록된 아이템 ID
      transactionid필수NSString결제 영수증 번호(GPA-xxx-xxxx-xxxx)
      currency선택NSString통화(KRW,USD)
      price선택NSDecimalNumber결제 아이템 금액
      paymentid선택NSString결제 스토어(apple)
      success선택GamePotCommonSuccess성공시 콜백
      fail선택GamePotCommonFail실패시 콜백
      NSString* productId = @"purchase_001";
      NSString* transactionId = @"xxxxxxxxxxx";
      NSString* currency = @"USD";
      NSDecimalNumber* price = [[NSDecimalNumber alloc] initWithString:@"1.09"];
      NSString* paymentId = "apple";
      NSString* uniqueId = "developer unique id";
      
      [[GamePot getInstance] sendPurchaseByThirdPartySDK:productId transactionId:transactionId currency:currency price:price paymentId:paymentId uniqueId:uniqueId success:^{
          // success
      } fail:^(NSError *error) {
          // fail
      }];
      

    이 문서가 도움이 되었습니까?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.