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 Deep Linking not working in Android #384

Closed
razam217 opened this issue Oct 27, 2017 · 17 comments · Fixed by #385
Closed

Branch Deep Linking not working in Android #384

razam217 opened this issue Oct 27, 2017 · 17 comments · Fixed by #385

Comments

@razam217
Copy link

razam217 commented Oct 27, 2017

Cordova: v6.1.1
Plugin Version: 2.6.14
In Android app, every time I click a deep link, it always return me the following object:
{ "+clicked_branch_link": false, "+is_first_session": false }
Very sometime it works, but 90% of the time it does not work. Although it opens the app correctly, but due to inappropriate data, the right functionality cannot be achieved.

Can you please help me with this?

@sudhanshu-pantelwar
Copy link

I am getting the same error. I had it working once only.

@chang-brian
Copy link

Hi everyone, please make sure to call initSession in two places—onDeviceReady and onDeviceResume: https://docs.branch.io/pages/apps/cordova-phonegap-ionic/#initialize-branch

I also recorded a video of my results: https://vimeo.com/240220208

When I monitored the traffic via Charles Proxy, I saw the link data go through every time (cold launch and warm launch) with this response:

{
	"session_id": "452548038150529018",
	"identity_id": "452541413092231107",
	"link": "https://btcmonkref.test-app.link?%24identity_id=452541413092231107",
	"data": "{\"+match_guaranteed\":true,\"$marketing_title\":\"Branch Test\",\"~creation_source\":1,\"~marketing\":true,\"+clicked_branch_link\":true,\"+click_timestamp\":1509134086,\"$one_time_use\":false,\"~id\":452542007165073544,\"+is_first_session\":false,\"~referring_link\":\"https://btcmonkref.test-app.link/KkahBYhOAH\",\"~feature\":\"marketing\"}",
	"device_fingerprint_id": "452541413050152201"
}

@razam217
Copy link
Author

Hi @chang-brian , I've been using branch.io for last two years. And I'm calling initSession in onDeviceReady and onDeviceResume.

It was working before smoothly in both Android and IOS, but after updating to latest branch.io version, Android is not working correctly.

@razam217
Copy link
Author

razam217 commented Oct 28, 2017

<intent-filter android:name="io.branch.sdk.UriScheme">
- <action_ android:name="android.intent.action.VIEW"/>
- <category android:name="android.intent.category.DEFAULT"/>
- <category android:name="android.intent.category.BROWSABLE"/>
- <data android:scheme="appName"/>
</intent-filter>

<intent-filter android:name="io.branch.sdk.AppLink" 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="appName.app.link" android:scheme="https"/>
- <data android:host="appName-alternate.link" android:scheme="https"/>
</intent-filter>

Here is my android manifest.xml file.

@gbelmm
Copy link

gbelmm commented Oct 29, 2017

+1 please help , I am getting the same error

@santiagobenini
Copy link

Same here. Suddenly it has stopped working here. Help please.

@aaustin
Copy link
Contributor

aaustin commented Oct 29, 2017

Hey guys - Thanks for letting us know about this issue. I've escalated it to engineering internally and we're looking into it. We believe it's related to a recent release on the core Android SDK that is not playing nice with Cordova. We'll keep you updated in this thread.

@Ziv-Barber
Copy link

Also not working here:
Cordova 7.10
Cordova Android 6.3.0
Plugin version 2.4.9

DeepLinkHandler not been called. It was working all the time and now no more deep links.

@santiagobenini
Copy link

@aaustin Hi Alex. Do you have any news or progress with this issue? thx

@ethanneff
Copy link
Contributor

We are actively looking into the issue. We will update this thread once we have pinpointed the problem.

@ethanneff
Copy link
Contributor

We have identified the issue with our underlying Android SDK. Data is being sent to the app, but the communication between our Branch Android SDK to our Branch Cordova SDK is not completing. For example:

Network Proxy:

{
	"device_fingerprint_id": "446348624952310946",
	"identity_id": "453626413799663885",
	"is_referrable": 1,
	"app_version": "1.0.0",
	"facebook_app_link_checked": false,
	"update": 1,
	"debug": false,
	"metadata": {},
	"hardware_id": "562fb61e9e7f03be",
	"is_hardware_id_real": true,
	"brand": "LGE",
	"model": "Nexus 5X",
	"screen_dpi": 420,
	"screen_height": 1794,
	"screen_width": 1080,
	"wifi": false,
	"ui_mode": "UI_MODE_TYPE_NORMAL",
	"os": "Android",
	"os_version": 23,
	"country": "US",
	"language": "en",
	"local_ip": "172.16.32.44",
	"environment": "FULL_APP",
	"android_app_link_url": "https:\/\/cordova.app.link\/LmZkxKZ0lE",
	"external_intent_uri": "https:\/\/cordova.app.link\/LmZkxKZ0lE",
	"cd": {
		"mv": "-1",
		"pn": "io.cordova.hellocordova"
	},
	"instrumentation": {
		"v1\/close-brtt": "373",
		"v1\/open-qwt": "0"
	},
	"sdk": "android2.13.0",
	"branch_key": "key_live_ndqptlgXNE4LHqIahH1WIpbiyFlb62J3",
	"retryNumber": 0
}
{
	"session_id": "453630463672698691",
	"identity_id": "453626413799663885",
	"link": "https://cordova.app.link?%24identity_id=453626413799663885",
	"data": "{\"custom_array\":\"[1,2,3,4,5]\",\"$og_title\":\"Content 123 Title\",\"$deeplink_path\":\"content/123\",\"source\":\"android\",\"$identity_id\":\"405804284757034548\",\"~stage\":\"new user\",\"~feature\":\"onboarding\",\"custom_object\":\"{\\\\\\\"random\\\\\\\":\\\\\\\"dictionary\\\\\\\"}\",\"$desktop_url\":\"http://www.example.com/desktop\",\"$canonical_identifier\":\"content/123\",\"~id\":408700391644095801,\"~campaign\":\"content 123 launch\",\"+is_first_session\":false,\"$android_url\":\"http://www.example.com/android\",\"~channel\":\"facebook\",\"$ios_url\":\"http://www.example.com/ios\",\"custom_boolean\":\"true\",\"$publicly_indexable\":\"false\",\"this_is\":\"true\",\"custom_integer\":\"1498679993676\",\"~creation_source\":2,\"$og_description\":\"Content 123 Description 1498679992450\",\"testing\":\"123\",\"custom\":\"data\",\"+click_timestamp\":1509392157,\"$match_duration\":\"2000\",\"$og_image_url\":\"http://lorempixel.com/400/400/\",\"custom_string\":\"data\",\"+match_guaranteed\":true,\"~tags\":[\"one\",\"two\",\"three\"],\"+clicked_branch_link\":true,\"$ipad_url\":\"http://www.example.com/ipad\",\"$one_time_use\":false,\"~referring_link\":\"https://cordova.app.link/LmZkxKZ0lE\"}",
	"referring_identity": "B Gyh",
	"device_fingerprint_id": "446348624952310946"
}

User Experience:

The app will still open via deep linking, analytics will be tracked, but deep link data will not pass through.

This issue is impacting different versions of the Branch Cordova SDK because our gradle file has a wildcard filter (compile 'io.branch.sdk.android:library:2+) (code). This wildcard also impacted our testing which is why this issue snuck into production. This is an oversight on our end, and we deeply apologize for the impact it has on your apps.

We will be submitting a new version with fix as soon as our testing is complete on our end.

Thank you for your patience,

@ethanneff
Copy link
Contributor

Hello again,

Thank you all for reporting the issue.

We have narrowed the problem to our Android SDK v2.13.0. This was released 4 days ago (https://github.com/BranchMetrics/android-branch-deep-linking/releases). As long as you have not pushed a version of your app to the Google Play Store in the last 4 days, your users have not been affected.

If you have pushed a new version of your app to the Google Play Store, can you please:

  • update your /plugins/branch-cordova-sdk/build.gradle
  • from compile 'io.branch.sdk.android:library:2+'
  • to compile 'io.branch.sdk.android:library:2.12.2'
  • push a new version of your app to the Google Play Store
  • (you might have to rebuild your platform with cordova platform rm android && cordova platform add android as well)

Furthermore, we will push a hotfix to the Branch Cordova SDK later today to mitigate this issue even further.

Again, I apologize for any inconvenience this has caused.

@gbelmm
Copy link

gbelmm commented Oct 30, 2017

great, trying thanks

@santiagobenini
Copy link

Hello Ethan,

Thanks to you and the team for the quick response. We have just re-built our platform and it seems everything is working normal again. I will keep you updated if any new problem arises.

Thanks

@ethanneff
Copy link
Contributor

I have updated the Branch Cordova SDK to downgrade the underlying Android SDK to the stable 2.12.2.

If you have not changed your /plugins/branch-cordova-sdk/build.gradle file, you can update your
Cordova Branch SDK to 2.6.16 to fix this issue. You can use this guide to update your Cordova Branch SDK.

We are still working on making the latest Android Cordova SDK (2.13.0) compatible with the Branch Cordova SDK. This will probably take a couple of days. In the meantime, the suggested solutions in this thread should fix your issues.

Thank you,

@razam217
Copy link
Author

Thanks @ethanneff . I think the issue is fixed with the latest Branch SDK Release. Our QA team is testing it, if I find any issue again I'll let you know.
Thanks again for a quick help.

@sojanpr
Copy link

sojanpr commented Oct 31, 2017

This was an issue with Android SDK version 2.13.0 . We have opened a PR BranchMetrics/android-branch-deep-linking-attribution#497 for this issue. Will be releasing shortly after QA pass

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

Successfully merging a pull request may close this issue.

9 participants