-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
flutter/engine
#40148Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressionplatform-androidAndroid applications specificallyAndroid applications specifically
Description
b/270298884
Follow the Android section of https://docs.flutter.dev/development/ui/navigation/deep-linking
If the deeplink is launched when the app is not open, it will launch with the default initial route / instead of the deeplinked route.
repro:
- create a flutter app
main.dart
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
routes: <String, WidgetBuilder> {
'/': (_)=> Scaffold(appBar: AppBar(title: Text('/'))),
'/abc': (_)=> Scaffold(appBar: AppBar(title: Text('/abc'))),
}
));- in /android/app/src/main/AndroidManifest.xml, add following meta tags in
xml
<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="flutterbooksample.com" />
<data android:scheme="https" />
</intent-filter>- do a
flutter runon any Android device (I am using motoG4) - force quit the app, and make sure the app is not in the background.
- run adb command
adb shell 'am start -a android.intent.action.VIEW \
-c android.intent.category.BROWSABLE \
-d "http://flutterbooksample.com/abc"' \
<package name>
expect: the page is opened with /abc in the appbar
actual: the page is opened with / in the appbar
This only happen if the app is started cold, if the app is in the background the deeplink command will work correctly.
Reactions are currently unavailable
Metadata
Metadata
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressionplatform-androidAndroid applications specificallyAndroid applications specifically