This page informs you how to port and build Hive SDK when developing games with Xcode.

Porting

To port Hive SDK into iOS-Xcode, you need Hive SDK dedicated for iOS. Hive SDK for iOS is required to port Hive SDK to Xcode. If you do not have Hive SDK yet, download Hive SDK Package for iOS from SDK Download Page and unzip the file.

Applying Framework

From Hive SDK v4.16.3, you can install Hive SDK framework with CocoaPods.

How to install CocoPods and Hive SDK
  1. Install CocoaPods.
  2. Create Podfile for the composition of CocoaPods configuration file.
  3. Add Hive SDK repository to the created Podfile using source command.
  4. Open Podfile with an editor and add frameworks required for Hive SDK. First, see the third party frameworks and their versions bound to Hive SDK iOS
    서드 파티 프레임워크의 종속성
    • HiveAuthV4ProviderAppsFlyer (23.0.0)
      • AppsFlyerFramework (6.12.1)
      • AppsFlyer-AdRevenue (6.12.1)
    • HiveAuthV4ProviderFacebook (23.0.0)
      • FBSDKCoreKit (16.2.1)
      • FBSDKLoginKit (16.2.1)
      • FBSDKShareKit (16.2.1)
    • HiveAnalyticsProviderFirebase (23.0.0)
      • FirebaseCore (10.16.0)
      • FirebaseAnalytics (10.16.0)
    • HiveAnalyticsProviderAdjust (23.0.0)
      • Adjust (4.35.2)
    • HiveAnalyticsProviderSingular (23.0.0)
      • Singular-SDK (12.1.1)
    • HiveAuthV4ProviderGoogle (23.0.0)
      • GoogleSignIn (7.0.0)
    • HiveGoogleRecaptcha (23.0.0)
      • RecaptchaEnterprise (18.4.0)
    • HiveAuthV4ProviderLine (23.0.0)
      • LineSDKSwift (5.10.0)
    • HiveAuthV4ProviderVK (23.0.0)
      • VK-ios-sdk (1.6.4)
    • HiveSDK (23.0.0)
      • SDWebIamge (5.18.3)

    The below is an example of writing a Podfile file. For more details, see Podfile.lock created after the installation of framework.

     

  5. Install the frameworks in accordance with the CocoaPods settings.

The list of frameworks that need to be added in the project’s main target in the CocoaPods Podfile is described as below.

The required frameworks for Hive SDK basic featuresThe optional frameworks for Hive SDK
  • HiveSDK
    • The essential one for the overall Hive SDK features
  • HiveAppTrackingTransparency
    • The framework for acquiring the app tracking permission for the devices with iOS 14 or higher
  • HiveResource
    • UI resource bundle (.bundle) provided by Hive SDK. It must be added in the main target of the project.
  • Hercules
    • Security Module Framework
  • HiveExtensions
    • Framework for additional extended features of Hive push notifications
  • HiveAnalyticsProviderAdjust
    • Adjust Marketing Tracking Framework
  • HiveAnalyticsProviderAppsFlyer
    • AppsFlyer Marketing Tracking Framework
  • HiveAnalyticsProviderFirebase
    • Firebase Marketing Tracking Framework
  • HiveAnalyticsProviderSingular
    • Singular Marketing Tracking Framework
  • HiveAuthV4ProviderAppleGameCenter
    • Framework for Apple Game Center Login
  • HiveAuthV4ProviderAppleSignIn
    • Framework for Sign in with Apple Login
  • HiveAuthV4ProviderFacebook
    • Framework for Facebook login and other social features
  • HiveAuthV4ProviderGoogle
    • Framework for Google Login
  • HiveAuthV4ProviderHive
    • Framework for Hive Membership Login
  • HiveAuthV4ProviderLine
    • Framework for Line Login
  • HiveAuthV4ProviderQQ
    • Framework for QQ Login
  • HiveAuthV4ProviderVK
    • Framework for VK Login
  • HiveAuthV4ProviderWechat
    • Framework for Wechat Login
  • HiveAuthV4ProviderWeverse
    • Framework for Weverse Login
  • HiveDataStore
    • Framework for storing and retrieving ancillary data per app user
  • HiveDeviceManagement
    • Framework for managing app users’ devices
  • HiveGoogleRecaptcha
    • Framework to use Google reCAPTCHA Enterprise based on bot score for guest logins
  • HiveIAPV4
    • Framework for in-app purchases and refund user repayment
  • HiveRealNameVerification
    • Framework for real-name verification of users with China IP
  • HiveSDKPlugin
    • Hive SDK Interface Plugin Framework for C++ language
  • HiveSDKUnityPlugin
    • Hive SDK Interface Plugin Framework for C# language

General settings

Follow the

instructions to set the following items:

  • [Set app status bar exposure]#statusbar) [Add whitelist]#whitelist) [Set access permission request]#permission) [Set notification]#push) [Add Apple Log-in to the IdP list]#idp-apple) [Setting up KeyChain]#keychain) Setting up Universal Link
Setting App Status Bar Exposure

Set the View Controller-Based Status Bar Appearance field value to NO not to expose the status bar in your app:

  1. Select your project in the Project Navigator in the Xcode Project window.
  2. Select your app from the TARGETS list.
  3. Click Info tab.
  4. Depending on the existence of the View Controller-Based Status Bar Appearance field in the Info tab, do the following:

    • If there is a field, select the field and set the value to NO.
    • If the field does not exist, add one.
      1. Right-click on the list of Info tab.
      2. Click the Add Row menu.
      3. Enter View Controller-Based Status Bar Appearance in the Key field.
      4. Set Type to Boolean.
      5. Set Value to NO.
Add whitelist
Facebook

To add Facebook Scheme to the whitelist, you can either [use the project window]#modify-ui-fb) or [add the code directly to the Info.plist file]#modify-infoplist-fb).

Editing in the project window1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Info tab.
  3. Click LSApplicationQueriesSchemes in the Info tab and click the + button to add the following two schemes.

    • fbapi * fb-messenger-share-api Editing Info.plist DirectlyYou can also add the code below directly to Info.plist.

QQ

To add QQ Scheme to the whitelist, you can either [use the project window] (#modify-ui-qq) or [add the code directly to the Info.plist file] (#modify-infoplist-qq).

Editing in the project window1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Info tab.
  3. Click LSApplicationQueriesSchemes in the Info tab and click the + button to add the following six schemes.

    • mqqOpensdkSSoLogin mqqopensdkapiV2 mqqopensdkapiV3 wtloginmqq2 mqq mqqapi mqqopensdknopasteboard * mqqopensdknopasteboardios16Editing Info.plist DirectlyYou can also add the code below directly to Info.plist.

Configure access requests

Add keys to Info.plist to gain access to camera, photo album and tracking.

  1. Select your project in the Project Navigator in the Xcode Project window.
  2. Select your app from the TARGETS list.
  3. Click Info tab.
  4. Click the Custom iOS Target Properties item in the Info tab.
  5. Right-click on the Custom iOS Target Properties list.
  6. Click the Add Row menu.
  7. Enter NSCameraUsageDescription in the Key item, and add the value specified in Multilingual Settings File > Base.Iproj folder > InfoPlist.strings to the Value item.

    • Write a message requesting permission to the game user specified in the multilingual configuration file. If you do not insert the permission approval request pop-up message, the additional explanation guide for the active user's access permission is missing and you will be rejected during app review.
    • If you apply the updated Permission.strings file from Hive SDK SDK v4.6.0, you must change this file as well. Otherwise, your app may be rejected at the App Store upload stage.
  8. Repeat steps 6-7 for NSPhotoLibraryUsageDescription and NSUserTrackingUsageDescription keys.
Configuring Notification

If push notification is not activated, the push tokens are not issued on iOS 10 devices, and apps may be rejected for the reason of 'Missing Push Notification Entitlement' during app review. Follow the instructions below to set up push notifications:

  1. Select your project in the Project Navigator in the Xcode Project window.
  2. Select your app from the TARGETS list.
  3. Click Capabilities tab.
  4. In the Capabilities tab, turn Push Notification on.
  5. To use Time Sensitive Notifications, set Capabilities > Time Sensitive Notifications as ON. (Operation Guide) - Users can receive the remote push of an app by turning on its Time Sensitive Notifications which is available from iOS 15.
Adding Sign In with Apple on IdP list

Hive v4.11.7.3 adds Apple, which is supported from iOS 13 on the available IdP list. This new IdP is available to add on Xcode 11 and later version. Follow the instructions to add a new IdP.

  1. Select your project in the Project Navigator in the Xcode Project window.
  2. Select your app from the TARGETS list.
  3. Click Signing & Capabilities tab.
  4. Click + Capability button on the left top of the Signing & Capabilities tab.
  5. Select Sign In with Apple on the list and add it.
  6. You can see Sign In with Apple listed on the Signing & Capabilities.
  • If Sign In with Apple is not on the Capability list due to authority or other issues, activate it on the Apple Developer Console. After the renewed provisioning is activated, add the new IdP by repeating from 4 to 6.
Configure KeyChain

Hive SDK KeyChain for the iOS target. No other additional configurations are needed when you do not use KeyChain-GroupSharing.

Universal Link Settings

Select the main TARGETS of the Xcode project, and set Domains as follows in the Associated Domains item of the Signing & Capabilities tab.

  • applinks:sandbox-promotion.qpyou.cn : Universal Link domain running in the Hive sandbox server environment* applinks:promotion.qpyou.cn : Setting up Universal Link domain server operating in Hive commercial server environment1. Change the values below to suit your environment and save them in the form of apple-app-site-association.

    • TEAM ID: TEAM ID retrieved from Apple Developer Console Bundle Identifier: Bundle ID of the app you want to use Universal Links URL Path: HTTP URL2 to support Universal Links. Upload to the root of the web server or a subpath of .well-known.
      1. Note * The format of the apple-app-site-association file is json, but do not create a file extension (.json) to it.

Configure iOS App1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Signing & Capabilities tab.
  3. Click + Capability button on the left top of the Signing & Capabilities tab.
  4. Add Associated Domains by selecting it from the list.
    Example domain with applinks:[apple-app-site-association] uploaded. applinks:hive-ota.withhive.com 6. On the developer console[https://developers.apple.com]https://developers.apple.com)), activate Associated Domain on the app’s Capabilities.

Configure hive_config.xmlRead and follow the setting in case of using Hive SDK without Unity Inspector.

  1. Edit or add the following line to the hive_config.xml file.

Configure hive_config.xmlRead and follow the setting in case of using Hive SDK with Unity Inspector.

  1. Click Hive > Edit Config > Unity Inspector and access to iOS tab.
  2. Enter the universal link address (Domain/Path) in the Universal Link item.
  3. How to check the settings * Access the UniversalLink address via the iPhone/iPad Safari browser after the app is installed. It’s good to go if you see the app opening UI like the one below when you see the browser.

Hive Settings

There are two configuration tasks to use Hive: [Add hive_config.xml to the project]#configure-xml) and [Set configuration items in Xcode]#configure-ui). Follow the instructions below to set up Hive:

Add the hive_config.xml file.

Add the [hive_config.xml]../configuration/) file to the project, which is in the Hive SDK SDK package downloaded from the developer site.

Setting Hive values in Xcode.

To use [Facebook]#fb-configure), [deep link]#ue), you need to set the Hive value in Xcode. Follow the instructions below:

Set up Facebook1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Info tab.
  3. In the Info tab, click Custom iOS Target Properties and enter your Facebook App ID in the FacebookAppID property.
    • In the Dashboard, enter Settings > Advanced > Security > Client Token and enter your Facebook Client Token in the FacebookClientToken property. (Required when using Facebook 13 or higher) (Reference Guide) 5. After clicking the URL Types item in the Info tab, click the + icon to create the Additional url type properties item.
  4. Enter the Facebook AppID with the prefix fb in the Additional url type properties item URL Schemes field.
    Example: fb012342478841523 VK settings1. Select your project in the Project Navigator in the Xcode Project window.
  5. Select your app from the TARGETS list.
  6. Click Info tab.
  7. In the Info tab, click Custom iOS Target Properties and add VK data to LSApplicationQueriesShcemes. (vkauthorize, vk-share, vk)5. After clicking the URL Types item in the Info tab, click the + icon to create the Additional url type properties item.
  8. In the URL Schemes field under the Additional url type properties item, enter the VK AppID with the vk prefix added.
    Example: Vk1231234WeChat settings1. Select your project in the Project Navigator in the Xcode Project window.
  9. Select your app from the TARGETS list.
  10. Click Info tab.
  11. After clicking the URL Types item in the Info tab, click the + icon to create the Additional url type properties item.
  12. Enter Identifier: weixin, weixinULAPI, URL Schemes: APP_ID in the URL Schemes field under Additional url type properties.
  13. Since Hive SDK SDK v4.14.0, as WeChat SDK version changes, Universal Link must be applied. For details, see General Settings > Universal Link.

Google settings1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Info tab.
  3. After clicking the URL Types item in the Info tab, click the + icon to create the Additional url type properties item.
  4. In the URL Schemes field under the Additional url type properties item, leave a blank for Identifier and enter reversed client ID for URL Schemes.

LINE settings1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Info tab.
  3. Click the Custom iOS Target Properties item in the Info tab and add LINE data to LSApplicationQueriesShcemes. (lineauth2)5. After clicking the URL Types item in the Info tab, click the + icon to create the Additional url type properties item.
  4. In the URL Schemes field under the Additional url type properties entry, enter your app bundle ID with the line3rdp prefix added.
    Example: line3rdp.$(PRODUCT_BUNDLE_IDENTIFIER)

Setting up Deep Link1. Select your project in the Project Navigator in the Xcode Project window.

  1. Select your app from the TARGETS list.
  2. Click Info tab.
  3. Click the URL Types item in the Info tab.
  4. Click the + icon to create an Additional url type properties item.
  5. Enter your AppID in the Identifier field and the URL Schemes field under Additional url type properties.

Applying HIVEAppDelegate

Call application:didFinishLaunchingWithOptions: API of HIVEAppDelegate in application:didFinishLaunchingWithOptions: API of AppDelegate.m file as in the following code.

Swift

API Reference: didFinishLaunchingWithOptions

Objective-C

API Reference: didFinishLaunchingWithOptions

 

Building

Build Settings

  1. Select your project in the Project Navigator in Xcode‘s Project window.
  2. Select your app from the TARGETS list.
  3. Click the Build Settings tab.
  4. Click on the Linking item and enter –Objc in the Other Linker Flags field.
  5. Click the Search Paths item and drag-and-drop the Hive SDK framework folder of the onto the Framework Search Paths.
  6. In Swift CompilerLanguage, if Swift Language Version is set to Unspecified, change it to 4 or higher. The external library dependencies will determine the option is whether to be exposed or not.
  7. Set the Enable Bitcode to NO.

Building

Build your app the as the usual way you build iOS apps.

 

Uploading app

Upload to the App Store

There are three ways to upload your app to Apple App Store Connect. You can upload the app directly in Xcode, run altool to upload it, or use Transporter.

Choose an upload tool

Check out Apple‘s guide

  • Upload Directly from XcodeAs of Xcode 11, you can either upload the version for App Store or for Ad Hoc directly, or create an .ipa file to upload by clicking the Distribute App button after selecting the product app. This is the generally recommended way to use the GUI.
  • altoolThe command line tool altool included with Xcode is located at /Applications/Xcode.app/Contents/Developer/usr/bin/altool. This is the recommended method when using an automated build system such as Jenkins. With the command line interface, the build artifacts can be validated, and directly uploaded. This altool uploading supports AppCenter (HockeyApp).
  • TransporterThis is the easiest way to upload content to the iTunes Store or App Store. You can upload not only your app, but also the contents in your app, such as playable content like videos, e-books, and music.

 

Upload directly from Xcode

Check out Apple‘s guide

  1. Launch Xcode Organizer. Xcode Organizer is launched from the Xcode menu or it automatically pops up after running an archivie task.
  2. Prepare for upload by clicking the Distribute App button. Depending on the target of the distributed version, you can choose the distribution method.
  3. Choose a distribution method. You can choose between uploading directly to AppStore Connect using Xcode, or extracting a file and uploading it.
  4. Choose the distribution option. You can chooseoptions when creating a distribution.
    • App Thinning: This function reduces the app size by separating resources by deployment target.
    • Rebuild from Bitcode: This is a function that activates the Bitcode to minimize changes when updating the app.
    • Include manifest for over-the-air installation: For Ad Hoc/Development builds, it is a function to attach a manifest file so that it can be downloaded/installed outside the App Store.
    • Strip Swift symbols: This feature reduces app size by removing unused Swift symbol files.
    • Upload your app’s symbols to receive symbolicated reports from Apple: After extracting and uploading the debug symbol, it supports receiving Apple’s symbolicated report.
  5. Add a signing certificate to your distribution build.
    Signing certificate on distribution build guarantees the app hasn’t been modified since it was last signed. Ad Hoc, App Store, or Development is available to sign on the distribution build. Select a certificate needed for app build and then upload or save the extracted file. If you extracted the .ipa file, you could use Transporter app to upload.
Upload with altool

Use command lines suitable for each situation to command your app upload. For more how-tos, see the linked guidelines below.

  • App Upload$ xcrun altool --upload-app -f file -t platform -u username [-p password] [—output-format xml]
  • Validate App$ xcrun altool --validate-app -f file -t platform -u username [-p password] [--output-format xml]
  • Notarize$ xcrun altool --notarize-app -f file --primary-bundle-id bundle_id -u username -p password
Upload with Transporter

The description for this method is not provided on this page. See the guide on Apple Developer.