Skip to main content

Install Unity SDK for iOS

Unity 2021.3.33f1 - Unity 2022
Version Requirements

Minimum supported iOS version is iOS 12, due to App Store Connect's upload requirements mandating the use of Xcode 15.

For Facebook, Firebase, DMM, Google, WeChat, Adjust, AppsFlyer, QQ, upgrade iOS SDK to version 12 and above.

For LINE, upgrade iOS SDK to version 13 and above.

Prerequisites

caution

The version of each SDK plugin used by the game, including the version used by the game launcher, must be consistent. If games require access to multiple versions of Player Network SDK at the same time, or if only one component needs to be upgraded, reach out to the Player Network representative.

  1. Get a login account from Player Network.
  2. Create a new project.
  3. [Optional] Invite users to join the project.
  4. Download the SDK.

Step 1: Install the SDK

1. Add Player Network SDK to your project

  1. Unzip the SDK package.
  2. Copy the INTLSDK folder to the Assets folder of your project.
  3. Merge the Plugins folder of Player Network SDK to the Plugins folder of your project.
Player Network SDK package
├─INTLSDK       // Player Network SDK CS scripts which provide APIs and callbacks
│ ├─Editor // Player Network SDK Editor scripts which include Player Network SDK XUPorter
│ └─Scripts // Player Network SDK scripts which include INTLCore and other plugin scripts
├─LevelInfinite // LI PASS APIs
├─Plugins // Player Network SDK plugins for various platforms
│ ├─Android
│ ├─iOS
│ ├─MacOS
│ └─Windows~
├─Symbols // Player Network SDK symbol table *.so files
└─UnionAdapter // UnionAdpater APIs which adapts to both MSDK and Player Network SDK
INTLSDK/Scripts/INTLCore
├─INTLSDK
│ ├─Editor
│ └─Scripts
│ ├─INTLConfig
| └─INTLCore
| ├─Editor // INTLCore PostProcess.cs / PreProcess.cs files for different platforms
| | ├─INTLCoreAndroidPostProcess.cs
| | ├─INTLCoreiOSPostProcess.cs
| | ├─INTLCoreMacOSPostProcess.cs
| | ├─INTLCoreWindowsPostProcess.cs
| | └─INTLCoreWindowsPreProcess.cs
| └─Scripts // INTLCore scripts
| ├─INTLAPI.cs // Player Network SDK APIs
| ├─INTLConfig.cs // Player Network SDK data structures
| ├─INTLDefine.cs // Player Network SDK static strings
| ├─INTLErrorCode.cs // Player Network SDK error codes
| ├─Modules
| └─Utils
├─LevelInfinite
├─Plugins
├─Symbols
└─UnionAdapter
INTLSDK/Script/INTLConfig
├─INTLSDK
│ ├─Editor
│ └─Scripts
│ ├─INTLConfig
| | └─Editor // Player Network SDK configuration files, PostProcess.cs files, and encryption tools
| | ├─Encrypt
| | | ├─decrypt // Player Network SDK decryption tool for INTLConfig.ini
| | | ├─Decrypt.exe // Player Network SDK decryption tool for INTLConfig.ini
| | | ├─encrypt // Player Network SDK encryption tool for INTLConfig.ini
| | | ├─Encrypt.exe // Player Network SDK encryption tool for INTLConfig.ini
| | | ├─EncryptConfig.ini // Player Network SDK file to enable or disable INTLConfig.ini encryption
| | | ├─INTLConfigINI.cs
| | | ├─INTLConfigINIEditor.cs
| | | └─INTLEditorTools.cs
| | ├─INTLConfigAndroidPostProcess.cs
| | ├─INTLConfigiOSPostProcess.cs
| | ├─INTLConfigMacOSPostProcess.cs
| | ├─INTLConfigSwitchPreProcess.cs
| | ├─INTLConfigWind...sPostProcess.cs
| | └─Resources // Player Network SDK configurations
| | ├─APASConfig.ini // APAS device level configuration file
| | └─INTLConfig.ini // Player Network SDK main configuration file
| └─INTLCore
├─LevelInfinite
└─Plugins

2. Load required permissions and plugins

XUPorter automatically adds dependency libraries and source code files when exporting Xcode projects to facilitate packaging.

Player Network SDK optimizes the original version of XUPorter which avoids conflicts between XUPorter solution and Player Network SDK.

  • The INTLSDKEditor namespace is added to avoid naming conflicts when other components also use XUPorter.
  • The search path to MODS files is changed. In this way, Player Network SDK XUPorter only searches for MODS files in the INTLSDK/ directory, rather than repeatedly adding the configurations of other components.
  • The lifecycle is added into UnityAppController.mm.

Player Network SDK XUPorter solution

INTL{Plugin}Kit.projmods is the Info.plist configuration file for Player Network SDK. Player Network SDK reads the INTL{Plugin}Kit.projmods file in the INTLSDK/Editor/XUPorter/Mods directory and adds the imported bundle, framework, and other dependency packages in Xcode.

As each INTL{Plugin}Kit.projmods file corresponds to a plugin, games need to update each file according to the game requirements for the plugin, and replace the {placeholder} text with values from the INTLConfig.ini configuration file.

For example, update INTLFacebookKit.projmods for required configurations.

INTLFacebookKit.projmods
"Info.plist":{
"LSApplicationQueriesSchemes":
[
"fb",
"fb-messenger-api",
"fbshareextension",
"fbauth2",
"fb-messenger-share-api",
"fbapi"
],
"NSAppTransportSecurity":
{
"NSAllowsArbitraryLoads":true
},
"FacebookClientToken":"{INTL_FACEBOOK_CLIENT_TOKEN}",
"CFBundleURLTypes" :
[
{
"CFBundleTypeRole":"Editor",
"CFBundleURLName":"Facebook",
"CFBundleURLSchemes":["fb{INTL_FACEBOOK_APP_ID}"]
}
]
}

iOS usage description

caution

When integrating, users can modify the contents according to their needs, then confirm with the legal team if the contents are compliant. If there are no modifications, replace INTLSample with the game name.

According to the requirements for iOS, when requesting sensitive permissions, fill in usage description when prompted by the system popup.

  1. In Assets/INTLSDK/Editor/XUPorter/Mods~/INTLCoreKit.projmods, the following permissions have been upgraded:

    "NSPhotoLibraryUsageDescription"
    "NSCameraUsageDescription"
    "NSLocationWhenInUseUsageDescription"
    "NSPhotoLibraryAddUsageDescription"
    "NSMicrophoneUsageDescription"

    When integrating, users can modify the contents according to their needs.

  2. In Assets/INTLSDK/Editor/XUPorter/Mods~/INTLADTrackingKit.projmods, the following permission has been upgraded:

    "NSUserTrackingUsageDescription"

3. Add compatibility for Swift SDK

Version requirements: iOS SDK 9 or later

There may be mixed editing issues for iOS Swift and Objective-C if the module uses the Swift SDK. Follow the below steps to create a bridge layer to align the class names of the two programming languages:

  1. Create a new file and choose the SWIFT File type.

    Image: Swift File type

  2. Specify the file name as needed and make sure that the extension is .swift, then click on Create.

    Image: Create Swift file

  3. Click Create Bridging Header.

    note

    Make sure to select Create Bridging Header. Otherwise, Xcode will not create a bridge layer file.

    Images: Create bridge document

  4. Make sure two files are created in the Xcode project (one is the .swift file created in step 2, and the other is the automatically created project_name-Bridging-Header.h file).

    note

    The file content remains unchanged.

    Images: Confirm document

4. Merge privacy manifest

Version requirements: Player Network SDK V1.22 or later

From Spring 2024, developers will have to clearly describe data use in the privacy manifest, showing how required reason APIs will be utilized in apps that are updated or uploaded to Apple App Store Connect. For more information, see Upcoming third-party SDK requirements.

With regard to the Player Network SDK plugins that are affected, INTLFoundation, INTLCore, and INTLGarena need to be merged manually, among which INTLGarena is only required if the project has integrated Garena.
In addition, INTLLine is integrated automatically in Player Network SDK and need not be configured.

For the other third-party SDKs that have yet to publish their privacy manifests, such content is not available in the Player Network SDK privacy manifest. For the list of plugins that have not been published yet, see iOS 17 Privacy Manifest.

Procedures

  1. Find the privacy manifest PrivacyInfo.xcprivacy for the required plugin from the Player Network SDK product catalog.

    PluginPath
    INTLFoundation/Plugins/iOS/INTLSDK/INTLFoundation/INTLFoundation.framework/PrivacyInfo.xcprivacy
    INTLCore/Plugins/iOS/INTLSDK/INTLCore/INTLCore.framework/PrivacyInfo.xcprivacy
    INTLGarena/Plugins/iOS/INTLSDK/INTLGarena/INTLGarena.framework/PrivacyInfo.xcprivacy
  2. Compare the 4 nodes of the PrivacyInfo.xcprivacy from Player Network SDK with the contents in the PrivacyInfo.xcprivacy from the game project, then merge based on the below conditions.

    1. Privacy Nutrition Label Types (NSPrivacyCollectedDataTypes) describes the data types used:
      Compare the Collected Data Type (NSPrivacyCollectedDataType) of each item, add the value to the game project file if they are different.
      If they are the same, instead compare Collection Purposes (NSPrivacyCollectedDataTypePurposes), add the value to the game project file if they are different.

    2. Privacy Tracking Domains (NSPrivacyTrackingDomains) lists the domains that engage in tracking:
      Compare the corresponding nodes, add the value to the game project file if they are different.

    3. Privacy Tracking Enabled (NSPrivacyTracking) describes if the App Tracking Transparency feature is enabled:
      Compare the corresponding nodes, modify the game project file if the value is YES in the Player Network SDK privacy manifest.

    4. Privacy Accessed API Types (NSPrivacyAccessedAPITypes) describes the API types used:
      Compare the Privacy Accessed API Type (NSPrivacyAccessedAPIType) of each item, add the value to the game project file if they are different.
      If they are the same, instead compare Privacy Accessed API Reasons (NSPrivacyAccessedAPITypeReasons), add the value to the game project file if they are different.

  3. Generate a privacy report using Xcode 15 to verify if expectations have been met.

5. Player Network SDK Configuration

note

When INTLConfig.ini is modified manually, reach out to the Player Network representative to confirm if configuration changes meet expectations, see SDK Config Information for more information.

Follow the instructions in INTLConfig.ini to configure accordingly.

6. Initialize the SDK

Before implementing any Player Network features, initialize the SDK first.

INTLAPI.IsDebug = true; // Set the SDK to the Debug mode to print out logs. The default value is false.
INTLAPI.InitSDK();

Step 2: Verify that Player Network SDK is successfully connected

  1. Modify the configuration under the INTL Log node in the INTLConfig.ini file.
[INTL Log]
LOG_LEVEL = 1
LOG_ENCRYPT_ENABLE = 0
LOG_COMPRESS_ENABLE = 0
LOG_CONSOLE_OUTPUT_ENABLE = 1
LOG_FILE_OUTPUT_ENABLE = 1
  1. Run the program, integration is successful when Init INTL SDK success. can be found in the log.

Now that the Player Network SDK has been successfully connected, you are ready to start building your project.

We recommend using the following services with Player Network:

  • Refer to our Authentication tutorials for a list of third-party identity providers you can incorporate into your project.
  • See Social for more information on the various social features that can be used to improve player interaction.
  • For instructions on how to configure in-game announcements and push notifications, see Engagement.
  • See Data Insights for ways to collect and report telemetry data.
  • Check out Tools & Utilities for a list of convenient tools provided by Player Network, such as Deep Link and WebView.
  • Depending on your countries/regions of release, determine the Compliance Services that may be required for your project.

Alternatively, gain access to all of the above features and more by simply adding LEVEL INFINITE PASS to your project.
Regular users can follow the streamlined workflow for standard solutions that work on most games, while more advanced users can begin customizing their project with minimal integration involved.

For more information, reach out to the Player Network representative.