Flutter Navigator 2.0

Nov 8 2022 · Dart 2.17.3, Flutter 3.0.2, Android Studio 2020.3

Part 4: Deep Links & Web Urls

19. Setup Deep Links

Episode complete

Play next episode

Next
About this episode
Leave a rating/review
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 18. Learn Deep Links Next episode: 20. Create a Navigation State Object

Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it's simply the best investment you can make in your development career.

Learn more Already a subscriber? Sign in.

Transcript: 19. Setup Deep Links

Episode - 19 Setup Deep Links

Now let us start by setting up deep links on our both the platfroms. To step up the deep links in android and ios we need to add some metadata tags in respective plaforms.

Open the info.plist present under ios/Runner/ directory. This is called as property List which defines the properties of our app behaviour. This is the same file where we add User Permission when app asks permission for location or photos. This file consists of Key - Value pair data. We are going to add few key - value pair data which will enable deep Linking for iOS.

<key>FlutterDeepLinkingEnabled</key>
<true/>
<key>CFBundleURLTypes</key>
<array>
  <dict>
  <key>CFBundleTypeRole</key>
  <string>Editor</string>
  <key>CFBundleURLName</key>
  <string>example.com</string>
  <key>CFBundleURLSchemes</key>
  <array>
  <string>rw_boojk</string>
  </array>
  </dict>
</array>

Each key is a parameter and we pass the value for that parameter, CFBundleUrlName is a unique URL that distinguishes our app from other in the same scheme. It takes domain as a value you can pass your domain or if you do not have domain flutter generally passes example.com, so can state with that.

Open AndroidManifest.xml located at android/app/src/main/AndroidManifest.xml and add the following code

<!-- Deep linking -->
<meta-data android:name="flutter_deeplinking_enabled" android:value="true" />
<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="rw_book"
  android:host="example.com />
</intent-filter>

Here also we are passing key value pair to our android app. First we enabled the deep linking in flutter and later pass scheme and package id.