example of how to deep link into a flutter app?

1,765 views
Skip to first unread message

Seth Ladd

unread,
Aug 9, 2017, 3:55:25 PM8/9/17
to Flutter Dev
Hi,

Does anyone have an example of how to "deep link" into a Flutter app, into a specific screen/view?

For example, a customer is asking "We need a URL that will 1) take the user to a specific part in our app (a chat, for example) if they have the app installed or 2) take a user to the device specific app store and then do 1) after they install the app."


If you have thoughts on how to do this, or better yet: example code, any pointers would be really appreciated.

Thank you!

Seth

Kyle Bradshaw

unread,
Aug 9, 2017, 4:54:40 PM8/9/17
to Flutter Dev
I'd love to see this in action too, so that my Firebase Cloud Messages can go directly to a specific route.

Christian Rivasseau

unread,
Aug 9, 2017, 5:12:14 PM8/9/17
to Kyle Bradshaw, Flutter Dev
I don't know if there is a way to do this directly in Flutter these days but it was very straightforward to
setup using platform messages (just receive messages using the native code (Intents in java IIRC)
and setup a method channel that tells Flutter to navigate to some route).

--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Christian Rivasseau
Co-founder and CTO @ Lefty
+33 6 67 35 26 74

Mikkel Ravn

unread,
Aug 14, 2017, 4:52:01 PM8/14/17
to Christian Rivasseau, Kyle Bradshaw, Flutter Dev
You should relay the url path into the Flutter framework using FlutterView.setInitialRoute, not by using custom platform messages (the latter are communicated asynchronously, and you need the initial route at hand to your Dart code before it renders its first frame).

On the Dart side, the String you give to setInitialRoute is made available as Window.defaultRouteName, which most apps shouldn't need to access directly, as it is already being used by MaterialApp and Navigator.

There is an older Android example here. The Dart part of it uses an older version of the MaterialApp/Navigator API. We're working on updating it to the latest version.
Mikkel Nygaard Ravn
Software Engineer

Seth Ladd

unread,
Aug 14, 2017, 5:02:00 PM8/14/17
to Mikkel Ravn, Christian Rivasseau, Kyle Bradshaw, Flutter Dev
On Mon, Aug 14, 2017 at 1:51 PM, 'Mikkel Ravn' via Flutter Dev <flutt...@googlegroups.com> wrote:
You should relay the url path into the Flutter framework using FlutterView.setInitialRoute, not by using custom platform messages (the latter are communicated asynchronously, and you need the initial route at hand to your Dart code before it renders its first frame).

On the Dart side, the String you give to setInitialRoute is made available as Window.defaultRouteName, which most apps shouldn't need to access directly, as it is already being used by MaterialApp and Navigator.

There is an older Android example here.

When you say "older" you mean "doesn't work anymore" or "still works but there is a better way" ?

Mikkel Ravn

unread,
Aug 14, 2017, 5:32:48 PM8/14/17
to Seth Ladd, Christian Rivasseau, Kyle Bradshaw, Flutter Dev
It most likely doesn't work anymore. The Navigation API changed quite a lot with #10894.
I believe Michael is looking at updating the example, and turning it into a real doc asset.

Seth Ladd

unread,
Aug 14, 2017, 5:49:25 PM8/14/17
to Mikkel Ravn, Christian Rivasseau, Kyle Bradshaw, Flutter Dev
On Mon, Aug 14, 2017 at 2:32 PM, 'Mikkel Ravn' via Flutter Dev <flutt...@googlegroups.com> wrote:
It most likely doesn't work anymore. The Navigation API changed quite a lot with #10894.
I believe Michael is looking at updating the example, and turning it into a real doc asset.

Great, thanks!

Bhupendra Acharya

unread,
Sep 21, 2018, 1:49:42 PM9/21/18
to Flutter Dev
Hello all,

Can you please share if there is any working examples ion the redirects?

I am looking with a web browser, will redirects to app some page and works in both android and ios.

Thanks
Bhupendra
Reply all
Reply to author
Forward
0 new messages