avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
564 stars 316 forks source link

How to get queryParams in Deeplink? #179

Open RB-93 opened 1 year ago

RB-93 commented 1 year ago

I am facing an issue in implementing deeplink using this package. All this are done as per the documentation. I managed all deeplinks on Firebase Console - Dynamic Links page.

Deeplink tapped from text message...

Deeplink example: https://xyz.com/userprofile?name=ABC

(operation performed on Android Platform)

  1. User taps on Deeplink from text message,
  2. App chooser bottom sheet opens up listing the app, browser options

When user selects the browser option say Chrome, the deeplink fetched contains all query params i.e., name=ABC in above deeplink example But, when user selects the App option, the deeplink is fetched but without query params!

tiagoon commented 1 year ago

You can use Dart's own Uri

void main() {
  final String initialLink = "https://example.com/?user=1&code=99"; 
  Uri uri = Uri.parse(initialLink);
  print(uri.queryParameters);
}