Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch link only opening Play Store when targeting Android 12 #921

Open
Garguy opened this issue Jul 21, 2021 · 23 comments
Open

Branch link only opening Play Store when targeting Android 12 #921

Garguy opened this issue Jul 21, 2021 · 23 comments

Comments

@Garguy
Copy link

Garguy commented Jul 21, 2021

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 Garguy changed the title Branch link not working any longer Branch link only opening Play Store when targeting Android 12 Jul 22, 2021
@Garguy
Copy link
Author

Garguy commented Aug 12, 2021

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

@iryna-murashova
Copy link

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

@Leo1305Pineda
Copy link

Also reproduces in our project.

@Garguy
Copy link
Author

Garguy commented Sep 27, 2021

Any updates on this?

@jf-branch
Copy link
Contributor

jf-branch commented Sep 27, 2021

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>

@Garguy
Copy link
Author

Garguy commented Oct 7, 2021

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

@mamgainS
Copy link

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

@jf-branch
Copy link
Contributor

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.

@Garguy
Copy link
Author

Garguy commented Oct 14, 2021

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>

@alexrbrowne
Copy link

Any updates on this?

@jf-branch
Copy link
Contributor

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.

@VvoidVano
Copy link

any update?

@alaegin
Copy link

alaegin commented Feb 8, 2022

The same issue in our project

@Abhishek284
Copy link

Abhishek284 commented Feb 10, 2022

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
Copy link

@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

@hazem3ly
Copy link

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

@jf-branch
Copy link
Contributor

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

@shubhamhackz
Copy link

@jf-branch Any update ?

@jf-branch
Copy link
Contributor

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.

@LYevhen
Copy link

LYevhen commented Apr 13, 2023

After release of Android API 31 there are some changes applied by google.
If You managing deep links on Your web page then You need to put:
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.example",
"sha256_cert_fingerprints":
["sha256_cert_fingerprints_REAL_VALUE"]
}
}]
in {your-domain}/.well-known/assetlinks.json (example.com/.well-known/assetlinks.json)
More is available here:
If You are using third party library for managing deep links, and configured everything on dashboard then first check what is returned by {your-domain}/.well-known/assetlinks.json (example.com/.well-known/assetlinks.json) - it should be the same as in example above in content for 'assetlinks.json'.
In other words If everything get broken after release of API 31 then You have to make sure that all links which are in Your AndroidManifest.xml in section and that application is published in playmarket and approved.
I had different config for dev env, and for prod, and links which was related on prod ( published to market ) did not include test links.
If links are associated with Your app and everything configured correct, You may go to Your app info ( long press on Your app on device) -> set as app default -> supported web addresses
there You should see Your links ( included in manifest file intent-filter section) and they should be enabled and You have to NOT have control ( toggle ) opposite to link, if You don't see any links or there is a toggle and it is turned off then something is wrong from steps above.
appInfo -> set as app default -> Open supported links ( toggle should be on )

@TechNift
Copy link

TechNift commented Nov 2, 2023

Hello @jf-branch any update about this issue, I've tried all the above suggested configuration but still OS 12 and above having same problem.
As you've mentioned, it's not reproducable on your end so would you like to share your app and a link to test so I can give a try to your app and verify it. I've tried different devices with OS 12 and higher, but no success so far.
If you could share your testing repo as well it would be really appreciated to compare configurations with my project.

Thanks.

@NidhiDixit09
Copy link
Contributor

@MateoParodi
Copy link

Any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests