Skip to content

Configure Info

Before you begin

Project Configuration

  1. Create client.txt file in your assets directory according to the following form:

    {
        "app_id": "21005e7c6680a5d2e8ee2ce1512e13d1",
        "app_id_facebook": "110142746174189",
        "client_token_facebook": "c63376b5e358e35c599f6ace5817f5b2",
        "client_name" : "SG111",
        "client_code": "SG111",
    }
    

    • Replace app_id with app_id provided by SohaGame.
    • Replace app_id_facebook with app_id_facebook provided by SohaGame.
    • Replace client_token_facebook with client_token_facebook provided by SohaGame.
    • Replace client_name with Game_Code provided by SohaGame.(SG401 or SG402,..)
    • Replace client_code with Game_Code provided by SohaGame (SG401 or SG402,..)
  2. Copy "google-services.json" file in project like either img.png

  3. Manifest.xml file configuration
    • Add android: name = "com.soha.sdk.SohaApplication" attribute and configure the as shown in the code below inside the tag:
      <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 is the app_id value provided by SohaGame, the same as described in Section 1 - client.txt

  • Use this tag android:exported="true" in Android Manifest.xml to register
  • Please add the following permissions:
    <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" tools:node="remove" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" tools:node="remove" />
    
  • Multidex configuration (For games that need to use multidex)
    Add multidex to build.gradle app:
    defaultConfig {
            applicationId "vn.sohagame.demosohagame"
            minSdkVersion 29
            targetSdkVersion 35
            versionCode 1
            versionName "1.0.1"
            multiDexEnabled true
        }