Integration Mode

Update time: 2021/09/25 14:21:29

Download and import the SDK

First, you can get Unity SDK on CommsEase IM SDK download page. Refer to the following diagram to import unitypackage to your project:

Import SDK

When importing SDK, you shall select all files there (if you had used an earlier version before, you shall delete all related files firstly).

Note: The postfix file of unitypackage does not support Chinese path, so that you shall save it under the path that contains English characters.

Configure Android Project

CommsEase Unity SDK is available to the following Android system version: V4.0 and later.

After importing SDK, you can find required permissions of SDK in AndroidManifest under Plugins/Android/:

xml<uses-permission android:name="android.permission.INTERNET" />
<!-- Getting the state of internet for app!!!. --> 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- write or read user data file for app!!!. -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>

Developers shall add these SDK permissions to AndroidManifest in their own APPs.

Configure iOS Project

1. Configure iOS Project

Available iOS system versions: iOS 8.0 and later.

When exporting iOS project, you can use it properly only after changing the following settings. If you do not publish it to iOS platform, this part can be ignored.

1.1 Change Compiling Settings (Build Settings) of the Project in Unity;

You can press the buttom "Ctrl+Shift+B" to open the "Build Settings" panel, click "Player Settings" to switch to the option card "Setting for iOS", select the bar "Other Settings" to change the value of "Script Call Optimization" under the configuration option "Optimization" to "Slow and Safe".

1.2 Change Compiling Configurations of Exported iOS Project in Xcode.
  • Add Other Linker Flags configuration: -lstdc++

  • Add system library:

    Security.framework

    CoreTelephony.framework

    SystemConfiguration.framework

    JavaScriptCore.framework

    libz.tbd

    libsqlite3.tbd

    Note: If there are some system libraries in the project, they shall not be added again.

  • Change Build Settings

    You shall select target configurations of compiling under TARGETS, switch to the tab “Build Settings”, and change configurations as follows:

    Note: The Xcode project that is generated under Windows with earlier version Unity tool may have the following problem: One of path separators in "Search Paths -> Library Search Paths" under the tab "Build Settings" shall be changed from "" to "/".

    It is changed as follows:

2. Precautions

If Unity SDK is configured manually, you shall pay attention to the following several problems:

2.1 Bitcode

If bitcode problem is proposed when Xcode is compiled, you can close bitcode or configure to support bitcode in Unity.

The earlier versions before Unity 4.6.9 do not support bitcode settings, but bitcode error will be prompted when the generated Xcode project is opened with Xcode7, because Xcode7 opens bitcode by default.

iOS 10 requires developers to add the description for adding permission application, otherwise, to send audio messages, developers should add the description of application for microphone permission. It can be added by the following two methods:

  1. You can add description information under "Player Settings" page in the latest version of Unity.

  2. You can find info.plist in Xcode project, open it and add the following key-value pair:

    key:Privacy - Microphone Usage Description

    value: Will app be allowed to use microphone?

Was this page helpful?
Yes
No
  • Download and import the SDK
  • Configure Android Project
  • Configure iOS Project
  • 1. Configure iOS Project
  • 1.1 Change Compiling Settings (Build Settings) of the Project in Unity;
  • 1.2 Change Compiling Configurations of Exported iOS Project in Xcode.
  • 2. Precautions
  • 2.1 Bitcode
  • 3. Privacy Permissions and Related Settings