This article describes how to set up the Payment Links SDK for Android.Documentation Index
Fetch the complete documentation index at: https://docs.appcharge.com/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
| Minimum target level | 24 |
Step 1 | Import the SDK
To import the Android Payment Links SDK, add the following implementation to yourbuild.gradle file:
settings.gradle file:
Step 2 | Add Permissions
In the Manifest file, add the necessary permissions to access the network state and enable incoming deeplink over HTTPS:Step 3 | Configure a URL Scheme
Next, add support for checkout activity and deeplink scheme:Step 4 | Set up foreground service for your checkout (Optional)
To improve checkout stability, you can enable a foreground service. This keeps your app prioritized while the checkout is open, helping prevent Android from closing or deprioritizing it during payment and network operations. To set up the checkout service:- Add the following permissions to your
AndroidManifest.xmlfile:
- Then register the service inside the
<application>tag. When this service is enabled, Android may display a notification from your game while the checkout is open. To make sure the notification uses your game name instead of the package name, setandroid:labelon the<application>tag:
If you’re upgrading an existing integration that already includes the
CheckoutService declaration, update android:foregroundServiceType from dataSync to shortService in your manifest. - After SDK initialization or before launching checkout, enable or disable the service in code:
By default,
setCheckoutServiceMode is enabled. If you don’t want to use the checkout service, remove the related permissions and the CheckoutService declaration from your manifest file, or disable it using the SDK Bridge method above. 