urlynk_flutter 1.1.1 copy "urlynk_flutter: ^1.1.1" to clipboard
urlynk_flutter: ^1.1.1 copied to clipboard

A Flutter plugin that provides complete solution for deferred deep linking and URL shortening.

urlynk_flutter #

URLynk (formerly DeepLynks) is a Flutter plugin that provides a complete solution for deep linking and URL shortening. It supports deferred deep linking—opening the app directly if installed, or redirecting users to the appropriate app store if not, while preserving the original link context across installation.

Features #

  • Quick Integration: Minimal setup required to get started.
  • Platform Support: Supports Android App Links and iOS Universal Links.
  • Branded Domain: Use your own branded domain to enhance visibility and user trust.
  • Deferred Linking: Seamlessly redirect users to the store for downloads and preserve link even after installation.
  • Free Tier: Generous free tier that covers most developers’ needs, including all essential features for deep linking.

Getting Started #

  1. Visit URLynk
  2. Create a free account
  3. Register your app and receive your App ID
  4. Generate your API Key

Installation #

Add this plugin to your pubspec.yaml:

flutter pub add urlynk_flutter

Platform Setup #

Android #

Requirements: minSdk >= 21

1. Update AndroidManifest.xml

PATH: android > app > src > main > AndroidManifest.xml

Add Internet permission

<uses-permission android:name="android.permission.INTERNET"/>

Add the following inside your .MainActivity <activity> tag.

<activity android:name=".MainActivity">

    <!-- Add the following lines below: START -->
    <meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
    <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="http" android:host="urlynk.in" android:pathPrefix="/<app_id>/" />
        <data android:scheme="https" android:host="urlynk.in" android:pathPrefix="/<app_id>/" />
        <!-- Optional branded domain support -->
        <!-- <data android:scheme="https" android:host="your.domain.com" android:pathPrefix="/<app_id>/" /> -->
    </intent-filter>
    <!-- END -->

</activity>

Note: app_id refers to the App ID generated in your URLynk account. It is not your Android applicationId.

Cleanup (Optional)

You no longer need to add JitPack, as URLynk is now available on Maven Central. If you are upgrading from version 1.0.0, remove JitPack from build.gradle (if it was only added for URLynk): PATH: android > build.gradle.kts or android > settings.gradle.kts

maven { url = uri("https://jitpack.io") } // Remove this

iOS #

Requirements: iOS >= 12.0 and Swift >= 5.0

1. Allow static pods in your Podfile

PATH: ios > Podfile

target 'Runner' do
  use_frameworks! :linkage => :static  # Update this line
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

2. Update AppDelegate.swift

PATH: ios > Runner > AppDelegate.swift

import Flutter
import UIKit
import URLynk // Add this line

@main
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }

  // Add the following method below.
  override func application(
    _ application: UIApplication,
    continue userActivity: NSUserActivity,
    restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void
  ) -> Bool {
    if userActivity.activityType == NSUserActivityTypeBrowsingWeb, let url = userActivity.webpageURL {
      try? URLynk.shared.handleDeepLink(url: url)
    }
    return true
  }
}

3. Add Associated Domains Capability

  1. Open the Runner.xcworkspace file in Xcode.
  2. Select the top-level Runner project in the Navigator.
  3. Go to the Signing & Capabilities tab.
  4. Click the + Capability button.
  5. Select Associated Domains.
  6. In the Associated Domains section, click the + button.
  7. Add this domain: applinks:urlynk.in
  8. (Optional) If you're using a branded domain, be sure to add it as well: applinks:your.branded.domain

Usage #

1. Configure URLynk Service #

NOTE: This method must be called before using any other methods.

final urlynk = UrlynkFlutter();
await urlynk.configure(apiKey: 'YOUR_API_KEY');
urlynk.onLinkData.listen((data) {
  if (res.error != null) {
    log('Received Data Error: ${res.error}');
  } else {
    log('Received Data: [${res.link}] ${res.data}');
  }
});
try {
  final deepLink = await urlynk.createDeepLink("any data in string format");
  if (deepLink != null) log('Deep link created: $deepLink');
} on PlatformException catch (e) {
  log(e.message ?? '');
}

NOTE: You can use any stringified data—such as absolute URLs, relative paths, query parameters, or JSON objects—to generate a deep link and retrieve this data when the link is opened.

Note: Short links are for URL shortening only. They do not open the app, redirect to app stores, or capture clicks on app launch like deep links do.

try {
  final shortLink = await urlynk.createShortLink(
    LinkModel(url: 'https://www.google.cn/search?q=urlynk'),
  );
  if (shortLink != null) log('Short link created: $shortLink');
} on PlatformException catch (e) {
  log(e.message ?? '');
}

5. Dispose the plugin resources #

urlynk.dispose();

Android Testing #

  1. Run the app on an emulator or physical device.
  2. Generate a deep link from the app.
  3. Execute the following command in your terminal while the app is running:
adb shell am start -a android.intent.action.VIEW -d "GENERATED_DEEP_LINK" YOUR_APPLICATION_ID_[NOT_APP_ID]

If successful:

  • The app should launch (if it was in the background).
  • onLinkData should receive the payload within a few seconds (depending on network stability).
  1. Run the app on a simulator or physical device.
  2. Generate a deep link from the app.
  3. Open the generated link in the device’s browser while the app is running.
  4. Ignore the redirect - in production, app will launch if installed, else users will be redirected to the Play Store; in development, this won’t work.
  5. Restart the app — onLinkData should receive the payload within a few seconds (depending on network stability).

NOTE: For direct app opening from browser, the app must be published on the Play Store or installed via a Play Store testing track.

Play Store Testing #

  1. Publish a test build to the Play Console testing track like Internal Testing.
  2. Add App Signing key certificate (SHA-256 fingerprint) in the URLynk app settings. Path: Play Console → Test and release → App Integrity → Play app signing → Settings
  3. Wait at least 5 minutes to allow the Digital Asset Links JSON to propagate.
  4. Verify deep link setup in Play Console: Play Console → Grow users → Deep links You should see the status All links working and your intent-filter data listed under App configuration web links.
  5. Share and accept the tester opt-in link on the device/account you plan to test with.
  6. Ensure app is not installed in this device.
  7. Open a generated deep link in the browser - it should redirect to your Play Store listing for the test build.
  8. Install the test build from the Play Store.
  9. Open the app after installation - onLinkData should receive the payload attached to the original link within a few seconds (depending on network stability).
  10. Copy your deep link into a text editor on your device, then tap it directly. This should open the app directly.

NOTE: When testing from the Play Store’s testing track, deep links may sometimes redirect to the Play Store page instead of opening the installed app. Use text editor method (step 10) for development. Rest assured, once your app is live, links will also open directly from the browser.


iOS Testing #

NOTE: During development, deep links will not open your app directly. Direct open is only possible when the app is live on the App Store (not just in Testflight).

  1. Run the app on a simulator or physical device.
  2. Generate a deep link from the app.
  3. Open the generated link in the device’s browser while the app is running.
  4. Ignore the redirect - in production, app will launch if installed, else users will be redirected to the App Store; in development, this won’t work.
  5. Restart the app — onLinkData should receive the payload within a few seconds (depending on network stability) and display it according to your setup (toast or UI output).

Important #

After publishing your app to the Stores, update the App Signing key certificate (SHA-256 key), Team ID, App Store URL in your URLynk app settings. This is essential for enabling direct app openings and proper store redirecting via deep links.

6
likes
0
points
103
downloads

Publisher

verified publishervalueoutput.com

Weekly Downloads

A Flutter plugin that provides complete solution for deferred deep linking and URL shortening.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on urlynk_flutter

Packages that implement urlynk_flutter