Handling Android App Links
Certain SDK features require configuring deep/app links handling so that the SDK can regain control and continue the flow when the user navigates back from an external context, such as a browser or another app. Choose one of the integration options below.
Please make sure to set your deep/app link on the backend using the following properties:
return_urlwhen creating an invoiceinvoice_return_urlwhen creating a customer token
(Option 1) Set App Links intent filter
The SDK includes POCustomTabRedirectActivity which handles redirects in web and app-to-app flows. You can set a custom intent filter for your deep/app link. Copy the following code to your AndroidManifest.xml and replace the data values to match your deep/app link:
<activity
android:name="com.processout.sdk.ui.web.customtab.POCustomTabRedirectActivity"
android:exported="true"
tools:node="replace">
<intent-filter
android:autoVerify="true"
tools:targetApi="m">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="your-app.com"
android:pathPrefix="/return"
android:scheme="https" />
</intent-filter>
</activity>(Option 2) Handle App Links in your app
Your app can receive an incoming deep/app link and delegate its processing to the SDK. Create a custom activity in your app and call the function processDeepLink to pass the URI from intent to the SDK:
class RedirectActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
intent.data?.let { uri ->
ProcessOut.instance.processDeepLink(
hostActivity = this,
uri = uri
)
}
finish()
}
}Register this custom activity and set an intent filter for your deep/app link in AndroidManifest.xml:
<activity
android:name=".RedirectActivity"
android:exported="true">
<intent-filter
android:autoVerify="true"
tools:targetApi="m">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="your-app.com"
android:pathPrefix="/return"
android:scheme="https" />
</intent-filter>
</activity>(Option 3) Use predefined deep link format
The SDK includes POCustomTabRedirectActivity which handles redirects in web and app-to-app flows. By default it uses a predefined deep link format: your.application.id://processout/return. Note that your.application.id must match the actual application ID, as it's specified in the intent filter:
<data
android:host="processout"
android:pathPrefix="/return"
android:scheme="${applicationId}" />Updated 8 days ago
