配置信息¶
开始之前¶
- 你必须要安装 Soha SDK。
- 支持 Android 10.0 及更高版本。
项目配置¶
- 在你的资产目录中创建
client.txt文件,内容如下:
{
"app_id": "21005e7c6680a5d2e8ee2ce1512e13d1",
"app_id_facebook": "110142746174189",
"client_token_facebook": "c63376b5e358e35c599f6ace5817f5b2",
"client_code": "SG111",
}
+ 将 app_id_facebook 替换为 SohaGame 提供的 app_id_facebook
+ 将 client_token_facebook 替换为 SohaGame 提供的 client_token_facebook + 将 client_code 替换为 SohaGame 提供的 Game_Code(例如 SG401 或 SG402 等)
- 将 "google-services.json" 文件复制到项目中,位置如下:
- Manifest.xml 文件配置
- 在
标签中添加 android:name="com.soha.sdk.SohaApplication" 属性,并按照以下代码配置 <application android:name="com.soha.sdk.SohaApplication" tools:replace="android:allowBackup,android:icon,android:label"> <activity android:name="com.soha.sdk.SohaActivity" android:exported="true" android:launchMode="singleTask" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:windowSoftInputMode="adjustPan" android:theme="@style/SohaAppTheme" > <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="https" android:host="account.sohagame.vn" android:pathPrefix="/app_id_SohaGame" /> </intent-filter> </activity> ....... </application>
PathPrefix 是 SohaGame 提供的 app_id 值,与第 1 节(client.txt)中描述的内容一致。
-
在 Android Manifest.xml 中使用标签
android:exported="true"进行注册。 -
请添加以下权限:
- 多 Dex 配置(适用于需要使用多 Dex 的游戏)
在 build.gradle 的 app 部分添加多 Dex 支持: