Skip to main content
This article explains how to integrate Unity Payment Links with the Android platform. To integrate with Android:
  1. Go to the Build Settings window and make sure your Unity project is set to Android. Once set, the AppchargeConfig file updates to display Android-specific configuration options. Android Build Settings
  2. Click Player Settings > Publisher Settings, and scroll to the Build section.
  3. Expose (enable) the following android plugin files or the build process will be passed without changes:
    • Custom Main Manifest (AndroidManifest.xml)
    • Custom Main Gradle Template (mainTemplate.gradle)
    • Custom Gradle Properties Template (gradleTemplate.properties)
    Android Editor Configurations
  4. Your configuration settings should look like this: Android Configurations
    By default, the configuration file is preconfigured for integration. However, you must set the required Environment and Checkout Public Key fields under Publisher Info.

    Publisher Info

    These settings can also be changed at runtime, but doing so requires re-initializing the SDK.
    PropertyValueDescription
    EnvironmentEnumSets the checkout environment. Use Sandbox for testing and Production for live payments.
    Checkout Public KeyStringDefines the checkout public key. You can find it by going to the Publisher Dashboard → Settings → Integration.

    Auto Integration Settings

    These settings automatically modify your AndroidManifest.xml and Gradle files to include all necessary dependencies at build time.
    You can choose to exclude or disable specific dependencies based on your project’s needs.

    Gradle Properties

    PropertyValueDescription
    Exclude Android XBooleanExclude the useAndroidX property from the gradleTemplate.properties file.
    Exclude JetifierBooleanExclude the enableJetifier property from the gradleTemplate.properties file.
    **Unity Standart Settings goes here**
    **ADDITIONAL_PROPERTIES**
    android.useAndroidX=true
    android.enableJetifier=true
    

    Gradle Dependencies

    PropertyValueDescription
    Exclude AppcompatBooleanExclude the AppCompat dependency from the mainTemplate.gradle file.
    Exclude Android BrowserBooleanExclude the AndroidBrowserHelper dependency from the mainTemplate.gradle file.
    Exclude KotlinBooleanExclude Kotlin package dependencies from the mainTemplate.gradle file.
    **---------------**
    
    dependencies {    
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        
        implementation 'androidx.appcompat:appcompat:1.3.0'
        implementation 'com.google.androidbrowserhelper:androidbrowserhelper:2.4.0'
        implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1'
        implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1'
        **DEPS**
    }
    
    **---------------**
    

    Manifest Modifications

    PropertyValueDescription
    Exclude Internet PermissionBooleanExclude the Internet permission from AndroidManifest.xml.
    Exclude Query BlockBooleanExclude Appcharge’s HTTPS scheme query block from the manifest.
    Exclude Appcharge ActivityBooleanExclude the Appcharge Checkout activity.
    Exclude Exported AttributeBooleanExclude the android:exported attribute from the Checkout activity.
    Exclude Discouraged Api ToolBooleanExclude <tools:ignore="DiscouragedApi"> from the Checkout activity.
    Exclude Appcharge Activity Intent FiltersBooleanExclude intent filters from the Appcharge Checkout activity.
    Exclude Custom SchemeBooleanExclude the <data android:scheme="acnative-{gameNameLowerCase}"> entry.
    Exclude Custom HostBooleanExclude the <data android:host="action"> entry.
    Exclude Https Scheme In ActivityBooleanExclude the <data android:scheme="https"> entry from the intent filter.

    Example Manifest

    If the options above are not excluded (disabled), your final Manifest will look like this:
    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
    <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    
    <queries>
      <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="https" />
      </intent>
    </queries>
    
    
    <application android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
      <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      </activity>
    
      <activity android:name="com.appcharge.core.CheckoutActivity" android:exported="true">
        <!-- Custom scheme -->
        <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="acnative-{IDENTIFIER}" />
          <data android:host="action" />
          <data android:scheme="https" />
        </intent-filter>
      </activity>
    </application>
    </manifest>
    
    The intent filter includes a scheme acnative-{IDENTIFIER}.
    If enabled, Appcharge integration settings automatically set this identifier to the last segment of your package name.
    For example, if your package name is com.appcharge.mysupergame, the identifier becomes mysupergame (lowercase, no spaces).

    General Auto Integration Settings

    PropertyValueDescription
    Enable Integration OptionsBooleanDetermines whether the SDK automatically applies required Xcode configurations during build. If disabled, you’ll need to configure them manually in Xcode.
    Use Internal BrowserBooleanUncheck it if you wish to open the checkout outside of your application with the default installed browser.

    Note: You can update this property programmatically before launching the checkout.
    Enable Debug ModeBooleanEnable this to print a summary of the automatic integration changes after the build.
    Disabling Enable Integration Options prevents automatic configuration required for the Checkout SDK to function correctly. If disabled, you must manually configure each required file.