简体   繁体   中英

Firebase dynamic link for not installed application

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: 在此处输入图像描述

The link preview (debug) show following picture: 在此处输入图像描述

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>

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..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM