deeplink_listener 1.0.3 copy "deeplink_listener: ^1.0.3" to clipboard
deeplink_listener: ^1.0.3 copied to clipboard

Deep linking allows your app to respond to links, whether they come from emails, websites, or other apps.

deeplink_listener #

Pub Package

Features #

Handling Custom Deep Links and Universal Links Deep linking allows your app to respond to links, whether they come from emails, websites, or other apps. There are two main types:

  • Custom URL Schemes – Works on both iOS and Android for listen custom deeplink.
  • Universal Links / App Links both IOS and Anroid for listen Universal Links.

Befor use #

if you are using Universal links your must be config you servr support IOS and Android handle deeplink Android to create https://youserveer.com/.well-known/assetlinks.json

[
  {
    "relation": ["delegate_permission/common.handle_all_urls"],
    "target": {
      "namespace": "android_app",
      "package_name": "com.yourdomain.app",
      "sha256_cert_fingerprints": ["YOUR_APP_SHA256_FINGERPRINT"]
    }
  }
]

IOS to create https://yourdomain.com/.well-known/apple-app-site-association

{
  "applinks": {
    "apps": [],
    "details": [
      {
        "appID": "teamId.com.yourdomain.app",
        "paths": [ "/apple-login-callback", "/callback/*" ]
      }
    ]
  }
}

Usage #

Make sure to check out examples

Installation #

Add the following line to pubspec.yaml:

dependencies:
  deeplink_listener: ^1.0.3

Basic setup #

The complete example is available here.

create your _linkSub  
StreamSubscription<String>? _linkSub;
String _deeplinkResult = 'Unknown';

⭐ Initial cold start

  • Get first time app never open and not active.
DeeplinkListener.getInitialLink().then((link) {
      print('[Dart] getInitialLink: $link');
      if (link != null) _handleDeepLink(link);
});

⭐ Stream for incoming links

  • Get all time when app live and in background.
 _linkSub = DeeplinkListener.linkStream.listen(
      (link) {
        print('[Dart] linkStream received: $link');
        _handleDeepLink(link);
      },
      onError: (err) {
        print('[Dart] linkStream error: $err');
      },
);

Funtion Handller #

  // Example handler
  void _handleDeepLink(String link) {
    // Do something with the link (e.g., navigation)
    setState(() {
      _deeplinkResult = link;
    });
    print("Handling deep link: $link");
  }

Note Don't forget cancel _linkSub before your view dispose #

@override
void dispose() {
    _linkSub?.cancel();
    super.dispose();
}
  1. Andoid Deeplink

  2. IOS Deeplink

how to run Testing in local #

Make sure you config all

  1. Android can run adb by add echo 'export PATH="$PATH:/Users/nemo/Library/Android/sdk/platform-tools"' >> ~/.zprofile, your .zsrc

//Check your device has been link 
 adb devices   
//Open Custom deeplink
adb shell am start -a android.intent.action.VIEW -d "myapp://open"
//Open Universal Links
 adb shell am start -a android.intent.action.VIEW -d "link.yourdomain.com"

  1. IOS no need you just : Open browser safari
//Open Custom deeplink
myapp://
//Open Universal Links
https://link.deepershort.com

Hello everyone 👋

If you want to support me, feel free to do so.

Thanks

============================================

សួស្ដី អ្នកទាំងអស់គ្នា👋

បើ​អ្នក​ចង់​គាំទ្រ​ខ្ញុំ សូម​ធ្វើ​ដោយ​សេរី ,

សូមអរគុណ

0
likes
0
points
19
downloads

Publisher

verified publisherdarith.info

Weekly Downloads

Deep linking allows your app to respond to links, whether they come from emails, websites, or other apps.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on deeplink_listener

Packages that implement deeplink_listener