how to redirect specific link to your app similar to whatsapp

Question

Asked by FTF S on November 01, 2021 (source).

how to create your app's link? like WhatsApp. if you click on this link https://wa.me/546497546464 that link takes you to WhatsApp app in your phone. like how to create a link that takes user to specific screen in your app? --in flutter--

Answer

Question answered by HasanAlyazidi (source).

That is called Deep Linking

The following from https://flutter.dev/docs/development/ui/navigation/deep-linking

Enable deep linking on Android

Add a metadata tag and intent filter to AndroidManifest.xml inside the <activity> tag with the ".MainActivity" name:

<!-- Deep linking -->
<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>

Enable deep linking on iOS

Add two new keys to Info.plist in the ios/Runner directory:

<key>FlutterDeepLinkingEnabled</key>
<true/>
<key>CFBundleURLTypes</key>
<array>
    <dict>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>CFBundleURLName</key>
    <string>flutterbooksample.com</string>
    <key>CFBundleURLSchemes</key>
    <array>
    <string>customscheme</string>
    </array>
    </dict>
</array>
FLUTTER HYPERLINK
SHARE: