android-branch-deep-linking-attribution icon indicating copy to clipboard operation
android-branch-deep-linking-attribution copied to clipboard

Branch link only opening Play Store when targeting Android 12

Open Garguy opened this issue 2 years ago • 22 comments

I have AdobeBranch 1.3.2 integrated into my project and on Android 11(sdk 30) everything works fine. Working to update my project to Android 12(sdk 31) I am no longer able to my Branch links open up my application when installed on emulator. It will open the play store no problem but will not open the installed app on the device. Its always redirecting me to the play store which will say open as the device has the application installed on it.

No idea why its failing on Android 12 and not Android 11. Any suggestions would be greatly appreciated.

Garguy avatar Jul 21 '21 18:07 Garguy

Any updates on this SDK not redirecting correctly with Android 12?

Garguy avatar Aug 12 '21 19:08 Garguy

The issue is also reproduces in our project. Is there any solution?

iryna-murashova avatar Sep 03 '21 13:09 iryna-murashova

Also reproduces in our project.

Leo1305Pineda avatar Sep 10 '21 13:09 Leo1305Pineda

Any updates on this?

Garguy avatar Sep 27 '21 15:09 Garguy

Hi @Garguy,

This is on our radar. Could you confirm with us that your Branch domains are properly added as intent-filters within your manifest with autoVerify="true"

i.e <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="branch-example.app.link" /> <data android:scheme="https" android:host="branch-example-alternate.app.link" /> </intent-filter>

jf-branch avatar Sep 27 '21 21:09 jf-branch

  <intent-filter android:autoVerify="true">
    <action android:name="androidintent.action.VIEW" />

    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <data
      android:host="open"
      android:scheme="navispherecarrier" />
  </intent-filter>

  <!-- Branch App Links -->
  <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:host="${branchSource}"
      android:scheme="https" />
  </intent-filter>
  
  Here is the part we have in for Branch in the manifest.

Garguy avatar Oct 07 '21 21:10 Garguy

Having the same issue in our project too with OS 12. Everything works fine with the older versions of android os(<=11).

mamgainS avatar Oct 13 '21 22:10 mamgainS

Hi all,

Something we noticed in our testings with Android 12 is the need to explicitly declare the exported boolean property to activities with the Branch intent filters when target SDK version is 31.

Could you confirm that android:exported="true" is added to your activity that has the Branch intent filters? i.e

<activity android:name=".MainActivity"
android:exported="true">

Simultaneously, @Garguy Could you provide us with additional information to help us reproduce, this includes, but is not limited to:

  1. Target SDK version.
  2. Emulator w/ Playstore context (Google API or Google Play)
  3. Branch SDK version, also with confirming it is our native Android SDK and not a plugin/wrapper.
  4. Activity with Branch intents information, is it singleTask? Is it the designated launcherActivity?

Thank you.

jf-branch avatar Oct 14 '21 01:10 jf-branch

1. 31
2. Emulator with Google Play
3. SDK implementation 'io.branch.sdk.android:adobebranchextension:1.3.2' also tried with just the solo Branch and same issue.
4. Single task and its the launcherActivity
      android:name=".view.activities.LauncherActivity"
      android:noHistory="true"
      android:screenOrientation="portrait"
      android:exported="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.DEFAULT" />
      </intent-filter>
      <intent-filter android:label="maps_intent_filter">
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
        <!-- note that the leading "/" is required for pathPrefix -->
        <!-- Accepts URIs that begin with "example://gizmos” -->

        <data
          android:host="map"
          android:scheme="navispherecarrier" />
      </intent-filter>

      <!-- Branch URI scheme -->
      <intent-filter android:autoVerify="true">
        <action android:name="androidintent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
          android:host="open"
          android:scheme="navispherecarrier" />
      </intent-filter>

      <!-- Branch App Links -->
      <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:host="${branchSource}"
          android:scheme="https" />
      </intent-filter>
    </activity>

Garguy avatar Oct 14 '21 21:10 Garguy

Any updates on this?

alexrbrowne avatar Nov 11 '21 16:11 alexrbrowne

Unfortunately, we are not able to reproduce this. I would strongly suggest filing a ticket with our support team here: https://help.branch.io/using-branch/page/submit-a-ticket So that additional investigation can be performed.

jf-branch avatar Nov 11 '21 17:11 jf-branch

any update?

VvoidVano avatar Jan 04 '22 05:01 VvoidVano

The same issue in our project

alaegin avatar Feb 08 '22 18:02 alaegin

I am having this issue due to setting of applicationIdSuffix ".debug" for debug builds

It works fine in os 11 and below, but with os 12, its not working when u add a suffix

Abhishek284 avatar Feb 10 '22 10:02 Abhishek284

@jf-branch I think you can reproduce this by setting applicationIdSuffix within build gradle for android apps. Once you install the app with applicationIdSuffix, please check the branch links and they will open playstore

Abhishek284 avatar Feb 14 '22 16:02 Abhishek284

I faced the same issue and the fix was to change the android URI scheme on branch dashboard in configuration/general section to our applicationId

hazem3ly avatar Feb 18 '22 15:02 hazem3ly

Hi everyone,

I think we were unable to reproduce because our test builds do not utilize an applicationIdSuffix. Thank you @Abhishek284 for calling that out and there is another GH Issue thread: https://github.com/BranchMetrics/android-branch-deep-linking-attribution/issues/969.

We are looking into this further and planning a course of action. We can support multiple package names (prod, debug, qa, etc) along with their corresponding SHA 256 certs on your app.link assetlinks files.

After we determine the best course of action, we will follow up here with further guidance.

jf-branch avatar Feb 18 '22 16:02 jf-branch

@jf-branch Any update ?

shubhamhackz avatar Sep 07 '22 09:09 shubhamhackz

Hi @shubhamhackz ,

With the release of Android API 31 there have been enforcements with verifications for Android App Links and URI schemes.

I would recommend to confirm all your build flavors package names and SHA Certs are declared in your Branch domains (app.link) Assetlinks file (.app.ink/.well-known/assetlinks.json).

Additionally if you utilize urls in your link data for params like $canonical_url, $original_url, $fallback_url, $android_url, etc, we scrape those sites for og tags as well as deeplink paths, therefore we utilize those paths for your uri scheme host. I would also confirm all possible deeplink paths are properly delcared for your uri scheme intent filter in your manifest, or utilize a wildcard (*) as your host for your uri scheme intent-filter declaration.

jf-branch avatar Sep 07 '22 14:09 jf-branch