BranchMetrics / android-branch-deep-linking-attribution

The Branch Android SDK for deep linking and attribution. Branch helps mobile apps grow with deep links / deeplinks that power paid acquisition and re-engagement campaigns, referral programs, content sharing, deep linked emails, smart banners, custom user onboarding, and more.
https://docs.branch.io/pages/apps/android/
MIT License
399 stars 156 forks source link

Handling long urls generated while offline #1179

Closed marcotta closed 6 months ago

marcotta commented 6 months ago

Describe the bug

I am using the the flutter branch sdk to integrate branch in a flutter app.

When there is no internet connectivity and I generate a link with a BranchUniversalObject it returns a long url that can be shared with other users.

I would like to be able to parse those links on another user device and retrieve the BranchUniversalObject properties.

Unfortunately when the url arrives to another device and gets parsed it does not return any info related to the BranchUniversalObject.

I have reported a bug on the flutter_branch_sdk but it seems this might be an issue in the native android implementation. See issue here

An example URL would be:

https://myapp.test-app.link/?%24randomized_bundle_token=1111111111111111111&feature=group&type=0&duration=0&source=android&data=eyIkb2dfdGl0bGUiOiJZb3UgaGF2ZSBiZWVuIGludml0ZWQgdG8gam9pbiBhIGdyb3VwIG9uIExvb3BpbmciLCIkY2Fub25pY2FsX2lkZW50aWZpZXIiOiJncm91cFwvM2M3YTg2YzItZjhjYy00ZDZlLTllMzctYjQ0ZDljNWI3NTFmIiwiJG9nX2Rlc2NyaXB0aW9uIjoiV2l0aCBMb29waW5nIGl0J3MgaW5jcmVkaWJseSBlYXN5IHRvIG1hbmFnZSBhbmQgY29vcmRpbmF0ZSBncm91cCBhcHBvaW50bWVudHMuIEV2ZXJ5Ym9keSBpcyBrZXB0IGluIHRoZSBsb29wISIsIiRvZ19pbWFnZV91cmwiOiJodHRwOlwvXC9zdGF0aWMxLnNxdWFyZXNwYWNlLmNvbVwvc3RhdGljXC81NjJmNGRjMmU0YjAxYzI1ZTAwYjQ2MmJcL3RcLzU4YzZlMzM3ZTNkZjI4YTE1OGMzODFjZlwvMTUwMTA5MTY1NDQwNlwvP2Zvcm1hdD0xNTAwdyIsIiRwdWJsaWNseV9pbmRleGFibGUiOiJ0cnVlIiwiZ3JvdXBfaWQiOiIxMjA1OTc5IiwidXNlcl9pZCI6IjEyMzU4MTMiLCIkZGVza3RvcF91cmwiOiJodHRwczpcL1wvbG9vcGluZy5hcHBcL2dyb3VwXC9pbnZpdGF0aW9uXC8zYzdhODZjMi1mOGNjLTRkNmUtOWUzNy1iNDRkOWM1Yjc1MWYiLCIkYW5kcm9pZF91cmwiOiJtYXJrZXQ6XC9cL2RldGFpbHM%2FaWQ9ZmFtaWx5bmV0LmRlLnNyYyIsIiRpb3NfdXJsIjoiaHR0cHM6XC9cL2l0dW5lcy5hcHBsZS5jb21cL2RlXC9hcHBcL2ZhbWlseW5ldC1kZWluLWZhbWlsaWVua2FsZW5kZXJcL2lkMTAwMzIwNTk4OD9tdD04In0%3D)ewogICAgIiRpb3NfdXJsIjogImh0dHBzOi8vaXR1bmVzLmFwcGxlLmNvbS8iLAogICAgIiRvZ19kZXNjcmlwdGlvbiI6ICJkZXNjcmlwdGlvbiIsCiAgICAiJGRlc2t0b3BfdXJsIjogImh0dHBzOi8vZ29vZ2xlLmNvbSIsCiAgICAiJG9nX2ltYWdlX3VybCI6ICJodHRwOi8vc3RhdGljMS5zcXVhcmVzcGFjZS5jb20vc3RhdGljLz9mb3JtYXQ9MTUwMHciLAogICAgIiRvZ190aXRsZSI6ICJ0aXRsZSIsCiAgICAiJHB1YmxpY2x5X2luZGV4YWJsZSI6IHRydWUsCiAgICAiJGFuZHJvaWRfdXJsIjogIm1hcmtldDovL2RldGFpbHM/aWQ9c29tZV9hcHAiLAogICAgIiRjYW5vbmljYWxfaWRlbnRpZmllciI6ICJhcHAvMDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtMDAwMDAwMDAwMDAwIgp9

what I would like to retrieve is the long base64 encoded data passed in the data query string of the URL

Steps to reproduce

  1. Generate a link with a BranchUniversalObject while there is no connectivity
  2. This generates a long url with a data query string
  3. Share the link with another user

Expected behavior

When the other user clicks on the link and the app opens, the BranchUniversalObject data should be available in

_branchSdk.listSession().listen(
      (data) {}
);

Actual behaviour

data is not available in the listen method

SDK Version

flutter_branch_sdk 7.1.0

Make and Model

Samsung Galaxy A32

OS

13

Additional Information/Context

Alternatively, is there a way to disable offline links so that I can report a problem to users?

echo-branch commented 6 months ago

Closing, it's a duplicate of the issue on the flutter repo.

marcotta commented 6 months ago

Hello @echo-branch, thanks for looking into the issue.

I see it has been closed as a duplicate, does it mean there were changes on the Android native package that should be integrated in the flutter project? Or does it mean there were no changes on the Android native package and the fix should happen entirely on the flutter project? Is there anything I can help with ?