Reputation: 11
Problem
I was expecting clicking on 'Get the app' button on Branch.io deepview would redirect me to the configured fallback URL on Android, but it redirected me to Google Play Store instead. What is the expected behavior? Does Branch.io deepview actually support redirecting to custom fallback URL?
Context
I am testing my Flutter app on an Android device. My app is not available on Google Play Store publicly yet, I was expecting deepview to redirect users to the fallback URL defined on branch dashboard so that users can download the app with the fallback URL.
If I enable the same deepview template on IOS, 'Get the app' button actually redirects to the custom fallback URL on IOS based on what is defined on Branch.io dashboard configuration page. But this doesn't work on Android.
If I disables deepview, clicking on the deep link does redirecting me to the fallback URL correctly on both IOS and Android.
The deep link is created using getShortUrl(...). The deepview is enabled on the branch.io dashboard using a custom template. There is no per link config set specifically for deep link or deep view.
Thank you so much!
Here is where I define the branch custom fallback URL.
Here is how I generate the link
BranchUniversalObject buo = BranchUniversalObject(
canonicalIdentifier: 'event/${widget.pageId}',
title: title,
contentDescription: contentDescription,
contentMetadata: BranchContentMetaData()
..addCustomMetadata('pageId', widget.pageId),
);
BranchLinkProperties lp = BranchLinkProperties(
channel: 'sharing',
feature: 'page_invite',
stage: 'new_share',
);
// Generate the link
BranchResponse response = await FlutterBranchSdk.getShortUrl(
buo: buo,
linkProperties: lp,
);
Here is what my Android Manifest file looks like (I didn't use the real app name, branch.io host link and package here as the app is not public yet. Used 'myapp' instead.)
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxxmyapp.myapp">
<application
android:label="MyApp"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<!-- If utilizing $deeplink_path please explicitly declare your hosts, or utilize a wildcard(*) -->
<!-- REPLACE `android:scheme` with your Android URI scheme -->
<data android:scheme="myapp" android:host="open" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
<!-- Branch App Links - Live App -->
<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" />
<!-- REPLACE `android:host` with your `app.link` domain -->
<data android:scheme="https" android:host="myapp.app.link" />
<!-- REPLACE `android:host` with your `-alternate` domain (required for proper functioning of App Links and Deepviews) -->
<data android:scheme="https" android:host="myapp-alternate.app.link" />
</intent-filter>
<!-- Branch App Links - Test App -->
<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.test-app.link" />
<!-- REPLACE `android:host` with your `-alternate` domain (required for proper functioning of App Links and Deepviews) -->
<data android:scheme="https" android:host="myapp-alternate.test-app.link" />
</intent-filter>
<!-- Add this intent filter for FCM notifications -->
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<!-- Branch init -->
<!-- REPLACE `BranchKey` with the value from your Branch Dashboard -->
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_xxxxx" />
<!-- REPLACE `BranchKey.test` with the value from your Branch Dashboard -->
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_xxxxx" />
<!-- Set to `true` to use `BranchKey.test` -->
<meta-data android:name="io.branch.sdk.TestMode" android:value="false" />
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT"/>
<data android:mimeType="text/plain"/>
</intent>
</queries>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Upvotes: 1
Views: 68