App Integration Guide
End-to-end setup for Flutter, iOS, and Android: HTTPS app links, optional URI scheme fallback, SDK initialization, and testing.
1. Overview
Flinku can deliver users into your app in two ways:
Universal Links / App Links (recommended)
iOS and Android open your app directly from the HTTPS short link (e.g. https://yourapp.flku.dev/abc123). Requires Associated Domains (iOS) and verified App Links (Android). This is the most seamless and secure path for production.
URI scheme fallback
The OS can open your app via a custom scheme (e.g. masroofati://). Easier to configure for quick tests, but weaker for security and consistency than verified HTTPS links.
2. Flutter integration
Step 1: Add dependency
dependencies:flinku_sdk: ^0.7.2
Step 2: iOS: Add Associated Domains
- Open Xcode → Runner → Signing & Capabilities → + Capability → Associated Domains.
- Add:
applinks:yourapp.flku.dev - If using a custom domain: also add
applinks:links.yourdomain.com(replace with your verified host).
Step 3: iOS: Add URI scheme (fallback)
In ios/Runner/Info.plist:
<key>CFBundleURLTypes</key><array><dict><key>CFBundleURLSchemes</key><array><string>yourapp</string></array></dict></array>
Step 4: Android: Add App Links
In android/app/src/main/AndroidManifest.xml inside <activity>:
<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="yourapp.flku.dev" /></intent-filter>
Step 5: Android: Add URI scheme (fallback)
<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="yourapp" /></intent-filter>
Step 6: Initialize SDK in main.dart
Firebase.initializeApp()) before reading FirebaseAuth if you use the snippet below.import 'package:firebase_auth/firebase_auth.dart';import 'package:flinku_sdk/flinku_sdk.dart';import 'package:flutter/material.dart';void main() async {WidgetsFlutterBinding.ensureInitialized();final user = await FirebaseAuth.instance.authStateChanges().first;final flinku = Flinku(userId: user?.uid ?? '',baseUrl: 'https://yourapp.flku.dev',);final link = await flinku.match();if (link != null) {// Navigate to link.deepLink// Access link.params for custom data}runApp(MyApp());}
3. iOS (Swift) integration
- Associated Domains: In Xcode, add
applinks:yourapp.flku.dev(and custom domain entries if applicable). - URI scheme: Add your URL scheme in
Info.plistas in the Flutter section above.
Initialize SDK (AppDelegate or SwiftUI)
import FlinkuSDKlet flinku = Flinku(userId: Auth.auth().currentUser?.uid ?? "", baseUrl: "https://yourapp.flku.dev")flinku.match { link inguard let link = link else { return }// Navigate to link.deepLink// Access link.params}
import FirebaseAuth (and configure Firebase) so Auth.auth() resolves.4. Android (Kotlin) integration
- App Links: Add the HTTPS
intent-filterwithyourapp.flku.devas in the Flutter section. - URI scheme: Add the optional
yourappscheme intent filter for fallback.
Initialize SDK (MainActivity or Application)
import dev.flinku.sdk.Flinkuval flinku = Flinku(userId = FirebaseAuth.getInstance().currentUser?.uid ?: "", baseUrl = "https://yourapp.flku.dev")lifecycleScope.launch {val link = flinku.match()link?.let {// Navigate to it.deepLink// Access it.params}}
com.google.firebase.auth.FirebaseAuth and ensure Firebase is initialized before use.5. Create links programmatically
Flutter SDK 0.7.0+ and native SDKs (iOS 0.7.0+, Android 0.7.0+, React Native 0.7.1+, Capacitor 0.7.1+, Unity 0.7.0+) expose createLink() so you can generate short URLs without calling the REST API directly. Pass your publishable key (flk_pk_) when configuring the SDK in the app. Never embed flk_live_ in client code.
Flutter
final flinku = Flinku(userId: user.uid,baseUrl: 'https://yourapp.flku.dev',apiKey: 'flk_pk_...', // publishable key only, never flk_live_);final link = await flinku.createLink(FlinkuLinkOptions(title: 'Summer Campaign',deepLink: 'yourapp://promo',params: {'ref': 'instagram', 'promo': 'SAVE20'},utmSource: 'instagram',utmMedium: 'social',));print(link.shortUrl); // https://yourapp.flku.dev/summer-campaign
iOS (Swift)
var options = FlinkuLinkOptions(title: "Summer Campaign")options.deepLink = "yourapp://promo"options.params = ["ref": "instagram"]flinku.createLink(options) { result inswitch result {case .success(let link):print(link.shortUrl)case .failure(let error):print(error)}}
Android (Kotlin)
val link = flinku.createLink(FlinkuLinkOptions(title = "Summer Campaign",deepLink = "yourapp://promo",params = mapOf("ref" to "instagram")))println(link.shortUrl)
createLinkInstant() returns the short URL instantly without waiting for the server. The link is saved in the background. Use this for share buttons where speed matters.
Flutter
import 'package:share_plus/share_plus.dart';final link = Flinku.createLinkInstant(FlinkuLinkOptions(title: 'Summer Campaign',deepLink: 'yourapp://promo',));await Share.share(link.shortUrl);
iOS (Swift)
let link = try Flinku.createLinkInstant(options)let activityVC = UIActivityViewController(activityItems: [link.shortUrl], applicationActivities: nil)
Android (Kotlin)
val link = Flinku.createLinkInstant(FlinkuLinkOptions(title = "Summer Campaign"))val sendIntent = Intent(Intent.ACTION_SEND).apply {type = "text/plain"putExtra(Intent.EXTRA_TEXT, link.shortUrl)}startActivity(Intent.createChooser(sendIntent, null))
6. Testing your integration
- Build and install the app on a real device.
- Create a test link in the Flinku dashboard.
- Open the link in Safari or Chrome (not by typing the URL manually).
- Verify the app opens directly from the link.
- Uninstall the app, tap the link, install from the store, then open the app and verify deferred deep linking restores the intended destination.