Game > Gamebase > iOS Developer's Guide > Getting Started

Environments

[INFO]

Minimum specifications

  • User run environment : iOS 11 or later
  • Build environment : Xcode 14 (iOS 16.1 SDK) or later


[Caution]

If some IdPs are supported, see the Support iOS Version field in the 3rd Party Gamebase Auth Adapters table shown below. When releasing the AppStore, Apple version policy must be complied with.

  • https://developer.apple.com/ios/submit/

Setting

Gamebase can be setup as below.

Download

Download Gamebase.xcframework.zip and required adapters.
Also download SDK files to authenticate each IdP, which are required only for a login.
Then, include corresponding SDK files to a target of your project.

Gamebase iOS SDK Components

Gamebase SDK Gamebase Auth Adapter External SDK & Compatible Version Usage Support iOS Version
Gamebase Gamebase.xcframework
Gamebase.bundle
NHNCloudSDK 1.6.2 Includes the interface and key logic of Gamebase iOS 11 or later
Gamebase Auth Adapters GamebaseAuthFacebookAdapter.xcframework FacebookSDK 14.1.0 Supports Facebook login iOS 11 or later
GamebaseAuthPaycoAdapter.xcframework PaycoID Login 3rd SDK v1.5.9 Supports PAYCO login iOS 11 or later
GamebaseAuthNaverAdapter.xcframework naveridlogin-sdk-ios-4.2.0 Supports NAVER login iOS 11 or later
GamebaseAuthGamecenterAdapter.xcframework GameKit.framework Supports Game Center login iOS 11 or later
GamebaseAuthGoogleAdapter.xcframework GoogleSignIn 7.0.0 Supports Google login iOS 11 or later
GamebaseAuthTwitterAdapter.xcframework Supports Twitter login iOS 11 or later
GamebaseAuthLineAdapter.xcframework LineSDK 5.8.2 Supports LINE login iOS 11 or later
GamebaseAuthAppleidAdapter.xcframework Sign In with Apple iOS 11 or later
GamebaseAuthHangameAdapter.xcframework HangameID SDK 1.8.6 Supports Hangame login iOS 11 or later
GamebaseAuthWeiboAdapter.xcframework weibo_ios_sdk-3.3.4 Supports Weibo login iOS 11 or later
GamebaseAuthKakaogameAdapter.xcframework KakaoGame 3.17.5 Supports Kakao login iOS 11 or later
Gamebase IAP Adapters GamebasePurchaseIAPAdapter.xcframework StoreKit
NHNCloudIAP 1.6.2
Supports in-game purchase iOS 11 or later
Gamebase Push Adapters GamebasePushAdapter.xcframework NHNCloudPush 1.6.2 Supports Push iOS 11 or later

[Caution]

When adding the AuthenticationServices.framework required for Sign In with Apple, it must be set to Optional. If it is set to Required, the devices running on iOS version 11 or earlier crashes immediately after launching the app.

Gamebase SDK iOS 2.13.0 or later supports Sign In with Apple in iOS 9 or later, and additionally the Service ID needs to be set in the Gamebase Console.


[Caution]

The Gamebase Framework files that contain Adapter in their name can be selected to determine whether they will be used within the project or not. It is recommended to remove any unused Adapter Frameworks. To use these Adapter Frameworks, the external SDKs specified in the above table might be required. For some Auth Adapters, be aware of the supported iOS versions listed in the table above. (If an Auth Adapter that supports iOS version 11 or later is included in the build, it will crash on iOS 10 or earlier.)


[INFO]

For setting of external SDKs which each IdP provides, refer to each IdP guide.

Xcode Settings

By decompression, following SDKs will show, including Gamebase.xcframework.

unzip gamebase

  • 1) Drag framework files to Project Navigator of the project and import. Note that added framework files should be added to a project target.
  • 2) Also add the Gamebase.bundle file to Copy Bundle Resources. Gamebase.bundle Bundle Resources
  • 3) To use Gamebase, a number of frameworks and library files must be added so that they can be referenced by the linker. This is to include the features of the external SDKs used by Gamebase in addition to the framework of Gamebase. You need to add the following:
    • libicucore.tbd
    • libz.tbd
    • libsqlite3.tbd
    • libc++.tbd
    • AdSupport.framework
    • ImageIO.framework
    • GameKit.framework
    • StoreKit.framework
    • Security.framework
    • AuthenticationServices.framework (Optional)
    • AppTrackingTransparency.framework (Optional)

Link Binary With Libraries

  • 4) When using Gamebase iOS SDK 2.12.0 or later, additional settings are required as Facebook SDK is updated.
    • Adding Accelerate.framework
    • Add an empty swift file within the project (When there are not any swift files within the project)
  • 5) Go to Target > Build Settings > Linking > Other Linker Flags and add -ObjC. Other Linker Flags
  • 6) When using NaverAuthAdapter, the NaverThirdPartyLogin.xcframework file provided by NAVER SDK should be added to Target > Build Phases > Embeded Frameworks. Naver Embeded Frameworks Naver Embeded Frameworks
  • 7) When using LineAuthAdapter, the LineSDK.xcframework file provided by LINE SDK should be added to Target > Build Phases > Embeded Frameworks. LINE Embeded Frameworks

[INFO]

The -ObjC option to the Linker allows all Objective-C classes and categories of Static Library to be loaded.
Therefore, if this option is not set, an error like selector not recognized may occur during runtime.


[Caution]

  • When building with Unity (2019.3 or later), import the Gamebase iOS SDK only to the UnityFramework target.
  • When you run Unity build, Unity-iPhone and UnityFramework are created in the Xcode project target.
  • Note that there may be problems with operation if you import the Gamebase iOS SDK in duplicate for each target.

CocoaPods Settings

You can set the Gamebase iOS SDK with CocoaPods.

  • 1) Execute Xcode to create a project.
  • 2) Execute the terminal to navigate to the directory of the project where CocoaPods will be applied.
  • 3) Execute the pod init command to create Podfile.
  • 4) Open the created Podfile with the editor and enter the following.
platform :ios, '11.0'

target 'SampleApplication' do
    pod 'Gamebase'
    pod 'GamebaseAuthFacebookAdapter'
    pod 'GamebaseAuthGamecenterAdapter'
    pod 'GamebaseAuthPaycoAdapter'
    pod 'GamebaseAuthNaverAdapter'
    pod 'GamebaseAuthTwitterAdapter'
    pod 'GamebaseAuthGoogleAdapter'
    pod 'GamebaseAuthLineAdapter'
    pod 'GamebaseAuthAppleidAdapter'
    pod 'GamebaseAuthWeiboAdapter'
    pod 'GamebasePushAdapter'
    pod 'GamebasePurchaseIAPAdapter'

    # Regarding how to use the following modules, please contact the Customer Center.
    pod 'GamebaseAuthHangameAdapter'
    pod 'GamebaseAuthKakaogameAdapter'
end

[Note]

Enter the target name of the created project in the target 'SampleApplication' do part.
You can specify versions by writing in this way: pod 'Gamebase', '2.48.0'. If no version is specified in each pod, the newest version is used.
Only some specific Adapters can be selected and applied.


[Caution]

If you do not use the latest Gamebase version, some adapter may not be available.

  • 5) Install Gamebase using the pod install or pod update command after Podfile is written.
  • 6) A [project name].xcworkspace file will be created when the installation is complete. From this point on, product is developed using the created xcworkspace file.

[Note]

For more detailed information on how to use CocoaPods, see Using CocoaPods at CocoaPods Guide.

IdP Settings

[Caution]

  • Make sure that Gamebase service is enabled by creating a new project from NHN Cloud Console.
  • Make sure that Client ID is issued by each IdP console and the IDs are entered in the Gamebase console.

Facebook

  • URL Scheme must be configured.
    • Go to Xcode > Target > Info > URL Types and add fb{App ID of the app you registered on the Facebook developers' site}
  • Register the Scheme in the Info.plist file.
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-share-api</string>
</array>

Google

PAYCO

  • URL Scheme must be configured.
    • Go to Xcode > Target > Info > URL Types and add tcgb.{Bundle ID}.payco
    • Go to Xcode > Target > Info > URL Types and add paycologinsdk.
  • URL Scheme must be configured.
    • Go to Xcode > Target > Info > URL Types and add tcgb.{Bundle ID}.naver
    • In NAVER Developers > My Application > API Settings > iOS > URL Scheme, add tcgb.{Bundle ID}.naver.
  • Register the Scheme in the Info.plist file.
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>naversearchthirdlogin</string>
    <string>naversearchapp</string>
</array>

Twitter

  • URL Scheme must be configured.
    • Go to Xcode > Target > Info > URL Types and add tcgb.{Bundle ID}.twitter
  • Need to configure Apps > Target Project > App Details > Callback URL on the Developer site of Twitter.
    • Add tcgb.{Bundle ID}.twitter://.

LINE

  • URL Scheme must be configured.

    • Go to Xcode > Target > Info > URL Types and add line3rdp.{Bundle ID}
  • For ATS setting, register the Scheme in the Info.plist file.

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>lineauth2</string>
</array>

Weibo

  • URL Scheme must be configured.
    • Go to Xcode > Target > Info > URL Types and add wb{App Key for apps registered on the Weibo developer site}.
  • Register the scheme in the Info.plist file.
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>sinaweibo</string>
    <string>weibosdk</string>
    <string>weibosdk2.5</string>
    <string>weibosdk3.3</string>
</array>

IdP Settings (Legacy)

Google

  • Gamebase iOS SDK 2.34.1 or earlier
    • URL Scheme must be configured.
      • Add tcgb.{Bundle ID}.google in Xcode > Target > Info > URL Types.
  • Gamebase iOS SDK 1.12.1 or earlier
    • You need to provide JSON string-type data in the Additional Info field in NHN Cloud Console > Gamebase > App > Authentication Information > Additional Info & Callback URL.
      • For Google, you need to set url_scheme_ios_only required for iOS apps.
      • The value of url_scheme_ios_only must match one of the values registered for the URL Scheme of Xcode.
    • URL Scheme must be configured.
      • Xcode > Target > Info > URL Types
  • Example of entering the additional authentication information for Google
{ "url_scheme_ios_only": "Your URL Scheme" }

gamebase_auth_google_console_01

NAVER

  • Gamebase iOS SDK 1.12.1 or earlier
    • You need to provide JSON String-type data in the Additional Info field in NHN Cloud Console > Gamebase > App > Authentication Information > Additional Info & Callback URL.
      • For NAVER, service_name, which is the app name to be displayed on the Agree to Login window, needs to be configured.
      • url_scheme_ios_only, information needed by iOS apps, needs to be configured as well.
    • URL Scheme must be configured.
      • Xcode > Target > Info > URL Types
  • Example of entering the additional authentication information for NAVER
{ "url_scheme_ios_only": "Your URL Scheme", "service_name": "Your Service Name" }

gamebase_auth_naver_console_01

LINE

  • Gamebase iOS SDK 2.42.2 or earlier
    • You need to provide the ChannelID issued by LINE in the Info.Plist file.
<key>LineSDKConfig</key>
<dict>
    <key>ChannelID</key>
    <string>{Issued LINE ChannleID}</string>
</dict>

3rd-Party Provider SDK Guide

Sample App

API Reference

Included in SDK.

API Deprecate Governance

The API which is not supported by Gamebase anymore is processed as deprecated (deprecate). A (deprecated) API can be deleted without any prior notice when the following conditions are met:

  • Minor version updates of five or more times.

    • Gamebase Version Format - XX.YY.ZZ
      • XX : Major
      • YY : Minor
      • ZZ : Hotfix
  • Time elapse of at least five months

TOP