Flutter deep link parameter

Viewed 176

I need to open a deep link in my Android app, like uniqueName://post/detail/1 in the router but it always removes the first part of the link: (post) and delegates only the rest: /detail/1 instead of /post/detail/1

AndroidManifest.xml:

<intent-filter android:priority="1">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="uniqueName"/>
</intent-filter>

onGenerateRoute:

  Route? onGenerateRoute(RouteSettings settings) {
    print('Change main route to: ${settings.name}');// prints /detail/1
}

Test:

adb shell am start -a android.intent.action.VIEW 
                   -c android.intent.category.BROWSABLE
                   -d "uniqueName://post/detail/1"
0 Answers
Related