Skip to main content

Mobile Application Deeplink Setup

Proper deeplink configuration is required for handling application redirection after payment completion — especially for e-wallet and online banking flows that redirect back to your app. See E-Wallet Payment Flow for the full app-to-app sequence.

info

This guide is based on the Mobile XDK Deeplink Redirection setup used across Fiuu Mobile XDK frameworks.

Overview

For this guide, the example application scheme is yourappscheme.

1.1 Android

Create a new activity (e.g. DeeplinkActivity) and add an intent-filter in AndroidManifest.xml:

<activity
android:name=".DeeplinkActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="yourappscheme" />
</intent-filter>
</activity>
warning

The scheme must use letters only, be all lowercase, and be a unique identifier that represents your app.

Handle the scheme in your activity using the incoming intent. This example uses React Native, but the same pattern applies to Flutter, Ionic Capacitor, and other hybrid platforms.

Kotlin:

class DeeplinkActivity : ReactActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val intent = intent
if (intent != null) {
Log.d("TAG", "Intent received: ${intent.data}")
if (isTaskRoot) {
intent.addFlags(
Intent.FLAG_ACTIVITY_REORDER_TO_FRONT or Intent.FLAG_ACTIVITY_CLEAR_TASK
)
intent.setClass(this, MainActivity::class.java)
startActivity(intent)
finish()
} else {
finish()
}
} else {
Log.d("TAG", "Intent is null")
}
}
}

Java:

public class DeepLinkActivity extends ReactActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

Intent intent = getIntent();
if (intent != null) {
if (isTaskRoot()) {
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT |
Intent.FLAG_ACTIVITY_CLEAR_TASK);
intent.setClass(this, MainActivity.class);
startActivity(intent);
finish();
} else {
finish();
}
} else {
Log.d("TAG", "intent is null");
}
}
}

1.3 iOS

Add Xcode URL Schemes:

  1. Open your project in Xcode.
  2. Navigate to TARGETSInfoURL Types.
  3. Add a new URL Type with your scheme (e.g. yourappscheme).
warning

URL Schemes must use letters only, be all lowercase, and be a unique identifier that represents your app.

2. Register App Scheme on Fiuu Portal

  1. Log in to the Fiuu Merchant Portal.
  2. Navigate to Merchant ProfileProfile SettingsRegistered a Serial Device / App Name.
  3. Add your scheme ending with :// in the App Url / Deeplink field.
    • Example: yourappscheme://
    • If your app uses a host, include it: yourappscheme://yourapphost
  4. The Serial No / App Name value must match your mp_app_name parameter in the XDK.

3. Run and Test

3.1 Android

  1. Clean and rebuild your app.
  2. Run using a release build after registering your App Url.
# React Native
npx react-native run-android --mode=release

# Flutter
flutter run --release

Or change the Active Build Variant to release before running, or install a release APK directly.

3.2 iOS

  1. Clean and rebuild your app.
  2. Set the Run Build Configuration to Release:
    • ProductSchemeEdit SchemeRunBuild ConfigurationRelease
  3. Run your app.

3.3 Verify

Test a payment flow that redirects back to your app (e.g. e-wallet or online banking). Confirm your deeplink activity receives the intent and returns the user to your main screen.

TNG eWallet Note (iOS Swift)

For Touch 'n Go eWallet on iOS, you may need to close the XDK manually after deeplink completion:

vc.startXDK(completion: onResults,
onFinishDeepLink: { vc.closePayment() })

See the Swift integration guide for details.