Vadziec Poplavsky
Vadziec Poplavsky

Reputation: 769

How to open flutter application from url?

For example, i have case in my flutter app when user can recover his password. In that case user will receive link on e-mail, and i want by clicking on that link, my flutter app will open, and route to specific screen.

Upvotes: 59

Views: 55157

Answers (5)

Qamar Khan Abbasi
Qamar Khan Abbasi

Reputation: 116

You do not need to use any package to just launch app from url (if
you don't want to get data from link)

          <!-- App Link sample -->

            <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="https" android:host="myapp.flutter.com" android:pathPrefix="/success" />
                <data android:scheme="https" android:host="myapp.flutter.com" android:pathPrefix="/failure" />
            </intent-filter>

            <!-- Deep Link sample -->
            <intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <!-- Add optional android:host to distinguish your app
                     from others in case of conflicting scheme name -->
                <data android:scheme="app" android:host="success" />
                <data android:scheme="app" android:host="failure" />
                <!-- <data android:scheme="sample" /> -->
            </intent-filter>
  • Just copy and paste in AndroidManifest.xml below code and launch in browser "app://success" or "app://failure".
  • Remember launch "app://success" or "app://failure" not search

Upvotes: 6

Heshan Sandeepa
Heshan Sandeepa

Reputation: 3687

Firebase Dynamic Links is no longer recommended, as per 2023

enter image description here

You may proceed with App Links or Universal links

Upvotes: 2

adelarsq
adelarsq

Reputation: 3738

You can use app_links, that supports Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler (desktop included) for Android, iOS, macOS, web and Windows.

Upvotes: 3

Kab Agouda
Kab Agouda

Reputation: 7289

So here , you must use a dynamic link. The best solution is the use of Firebase Dynamic Links .

One of the advantages of Firebase Dynamic Links: Convert mobile web users to native app users

With Dynamic Links, you can seamlessly transition users from your mobile website to the equivalent content within your app. And because the links survive the app install process, even new users can pick up where they left off on your mobile site without missing a beat.

enter image description here

Another solution is to switch to native solutions: Android and iOS.

Upvotes: 6

TWL
TWL

Reputation: 6664

You'll want to view this from the perspective of: How do I open my iOS/Android app from a URL, ie. App Deep Linking.

They each have their own respective implementations:

Or you can go with more comprehensive SDKs that are capable of doing both for you:

Upvotes: 18

Related Questions