-
Notifications
You must be signed in to change notification settings - Fork 28.6k
Deeplink URL scheme should also include domain name (iOS and Android) #100624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @naamapps, Thanks for filing the issue. I am quite not sure I understood the issue, When I configure the deeplink I am able to launch the app.
Could you please clarify what exactly you meant by this? Do you mean |
Hey sorry for the confusion. It is launching the app on both cases but the route is not correct. somescheme://search - launches the app but the 'search' is ignored, so the search route is not the first route. somescheme://blabla/search - launches the app and directs to the correct search route. (so the blabla is ignored, and only the second section is being used to determine the initial route of the app). Hope it's clearer |
Thanks for the clarification @naamapps, Could you please share a minimal reproducible code sample that shows the route path is incorrectly fetched? |
Put this in your main.dart. And if you run
|
Thanks for the code sample @naamapps, I am seeing a different behavior on Android
AndroidManifest.xml <intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="somescheme" android:host = "" />
</intent-filter> Info.plist
flutter doctor -v (mac)
|
@maheshmnj But either way, we can clearly see that something is not working here. |
@naamapps sorry about that, Please ignore the host I accidentally added it. Even without the host with the below Intent-filters
Running
still returns Could you please reconfirm if you are seeing the same behavior on Android? |
I do not, I see /search. |
Sorry about that, I missed that part now I am able to reproduce the same behavior as you.
I believe it is working as intended since anything that follows "//" will be part of the hostname so "blabla" in the above case won't be returned. Labeling this issue for further investigation from the team. code sampleimport 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
onGenerateRoute: (settings) {
return MaterialPageRoute(builder: (_) {
return BugPage(path: settings.name ?? "Unknown route");
});
},
title: 'Bug',
);
}
}
class BugPage extends StatefulWidget {
final String path;
const BugPage({Key? key, required this.path}) : super(key: key);
@override
State<BugPage> createState() => _BugPageState();
}
class _BugPageState extends State<BugPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text("path: " + widget.path),
),
);
}
}
flutter doctor -v (mac)
|
I don't believe it's the intended behavior. It's 100% a bug |
I'm also facing this issue, when configuring routes using When I launch |
The first part is domain name, and currently router only gets the path part plus query parameter and segment. |
It it helps for anyone you can bypass the host by using only one slash after schema... For example |
This come up during the discussion for deeplink, this is currently blocking app to handle deeplink from different domain names |
I am actually having trouble with this behavior as well. |
related flutter/flutter#100624 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
related flutter/flutter#100624 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Close as done |
Thanks for finishing this issue. I knew |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
Setup url scheme for both ios and android, on android without the host data and on ios like normal:
Android:
ios:
After setup, try to launch the app on both platform with the scheme like this:
somescheme://search
You'll see that the search part is ignored.
If we try to launch the app like this:
somescheme://blabla/search
It will work!
Expected results: URL schemes should work out of the box with no issues, without ignoring the first URL section.
Actual results: Flutter ignores the first URL section when launching the app from a url scheme.
Flutter doctor
This will be done in series of three prs:
The text was updated successfully, but these errors were encountered: