RodrigoSMarques / flutter_branch_sdk

Flutter Plugin for create deep link using Branch Metrics SDK. This plugin provides a cross-platform (iOS, Android, Web).
https://branch.io
MIT License
100 stars 90 forks source link

Android non branch deep link sometimes not available #308

Closed vasa137 closed 5 months ago

vasa137 commented 7 months ago

Describe the bug When I try to open the app with the non-branch deep link, non_branch_link field sometimes doesn't provide the url I've clicked on.

To Reproduce Steps to reproduce the behavior:

  1. I've clicked on the link with the custom domain: dev-app.operi.rs/home/orders
  2. Branch SDK logged this D/FlutterBranchSDK( 3719): BranchReferralInitListener - params: {"+non_branch_link":"dev-operi-app:\/\/open?link_click_id=1304070486333205728","+clicked_branch_link":false,"+is_first_session":false}
  3. listSession method returned this value in the callback

Expected behavior I've expected to get non_branch_link = dev-app.operi.rs/home/orders

Smartphone (Please complete the following information. remove session if not platform):

In some periods of the day - the expect behavior is happening, but mostly it returns dev-operi-app:\/\/open?link_click_id=XXX. Also, on Xiaomi I've never received this type of the response - it's always the original link.

RodrigoSMarques commented 7 months ago

Hi @vasa137 .

This package calls Branch Native SDK functions on each platform.

The problem reported is not in the Flutter plugin, but in the Native SDK.

Please open an issue in the platform repository:

Or open a support ticket for Branch at the link

kalismeras61 commented 6 months ago

@RodrigoSMarques i am also having same issue, it is returning open?link_click_id=1304070486333205728. instead of returning non branch uri

How we can handle this?

vasa137 commented 6 months ago

I think the only option is to Generate the link on the Branch portal - since nonBranch links which are using the same domain you registered on Branch Portal will return this thing....

I reached support - but no luck.

kalismeras61 commented 6 months ago

I think the only option is to Generate the link on the Branch portal - since nonBranch links which are using the same domain you registered on Branch Portal will return this thing....

I reached support - but no luck.

But i believe it was working fine it is weird. If they are not going to show non branch links, why is there such a parameter...

RodrigoSMarques commented 6 months ago

I believe I have identified the problem. I'm already working on the next version. It will be made available in the next few days.

kalismeras61 commented 6 months ago

@RodrigoSMarques any update ?

RodrigoSMarques commented 6 months ago

@RodrigoSMarques any update ?

Reviewing the documentation, as there will be changes to the init method and the way to activate the test key. It will no longer be possible to configure via code.

RodrigoSMarques commented 6 months ago

@kalismeras61 @vasa137

Version 8.0.0 released.

Take the tests and report the results.

vasa137 commented 5 months ago

Looks like it's solved in version 8.0.1 - I will monitor it a little bit more - since it was working from time to time before - looks promising until now.

vasa137 commented 4 days ago

Hello @RodrigoSMarques, it stopped working completely recently. I noticed issues in my app (using version 8.2.0). So non_branch_link again shows some weird things (link_click_id) without path

I was testing with: https://app.operi.rs/home/profile and I get in the flutter app - operi-app://?link_click_id=...

Also, what I noticed recently (not sure if it's connected with this thing) - when app is brought from background - like after recaptcha check on Firebase - deep link listener is triggered with "/" value, causing my app to go to home screen, instead of staying on the current screen (before going to background). But this is definitely smaller problem (but maybe they are connected).

Can you please fix again?

RodrigoSMarques commented 2 days ago

@vasa137

I couldn't understand the scenarios you reported.

Remember that when clicking on a deeplink, Branch services (API) are responsible for returning the data.

The plugin only bridges the gap between the native code and Dart.

If the data returned for a deeplink is incorrect, it is due to the Branch API return, not the plugin.

Note: If the application was in the foreground, goes to the background and returns, the Branch SDK always "restarts" the return data.

vasa137 commented 1 day ago

I believe I have identified the problem. I'm already working on the next version. It will be made available in the next few days.

But few months ago, you identified the issue an it was working fine, now the issue is happening again.

The problem is - when I click on deep link - path always get transformed to "/open?link_click_id=...".

@kalismeras61 had the same problem, and android branch sdk library developers cannot identify what's wrong.

Clicked link: dev-app.operi.rs/home/profile

Flutter output: non_branch_link: dev-operi://open?link_click_id=

So scheme transformed to my app scheme, and path transformed to /open which is totally strange.

I just tested it a lot - and I found out when I click on the link with https prefix:

https://dev-app.operi.rs/home/profile prefix it works well

If link is just dev-app.operi.rs/home/profile it doesnt work.

Wow. Maybe it's converted to http and fails to resolve