skip to Main Content

I have a problem with dynamic link at Firebase not redirecting me to Play Store if the application is not installed.

The dynamic link is defined as following:
enter image description here

The link preview (debug) show following picture:
enter image description here

according to this one if I click on the link and application is not installed I would be brought to Play Store. However it just opens a browser and opens the web link. The "Play Store" link though is functioning and brings me to the Play Store.

One more detail. When I click on the dynamic link on my Android phone I see three steps:

  1. A browser window with "google.com" URL opens shortly.
  2. Browser window is closed and I see original screen where I clicked on the link with a ring rotating for less than a second.
  3. A browser windows opens again but this time with web link opened

And same happens even if the application is installed.

Is there a way to debug this behavior and get some better understanding of what’s the reason?

The AndroidManifest.xml is defined as following:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.myapp">
    <uses-permission android:name="android.permission.READ_CONTACTS" />  
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-feature android:name="android.hardware.camera" />
    <uses-feature android:name="android.hardware.camera.autofocus" />
    <uses-feature android:name="android.hardware.camera.flash" />    
    <application
        android:label="myapp"
        android:name="${applicationName}"
        android:icon="@mipmap/icon">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            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>
            <!-- 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" />
                <data android:scheme="https" />
                <data android:host="myapp.com" />
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

2

Answers


  1. Chosen as BEST ANSWER

    So, it turned out my approach to dynamic links building was wrong. Dynamik link creation as shown in the question is a way to establish static links that don't change and have no parameters. It's usable to bring users to a specific part of your application that never changes.

    In case of using dynamic link, which is dynamic in its nature like in my case - invitation link that allows to install application if it's not yet installed, run it and bring the user to a specific part of the application with parameters would be:

    1. Define a URL prefix enter image description here
    2. Publish the application at Play Store at least in closed testing mode. Internal testing seems not to be enough because it's available only by internal testing ID and not the package ID.
    3. Generate URL of type: https://myapp.page.link/?link=https://myapp.com/join/invitation_id&apn=com.myapp

    That is enough to make work for Android. For iOS it's not tackled yet.


  2. As you mentioned it is in debug , i believe here that application is not present on playstore right now and that’s why it is not redirecting you to playstore in case of app is not installed on your device but yes , it should open your app if it is already installed on your device

    so make sure above scenario .. if flow is working same as mentioned then no worries everything is fine but if it is not working as mentioned then you need to mention code of creating link , manifest file , activity where you are handling it etc ..

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search