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

Android app not getting correct deeplink from Branch when app is opened #283

Closed
appeventic opened this issue Jan 9, 2024 · 31 comments
Closed
Labels
bug Something isn't working Waiting for Test Waiting for test results after release

Comments

@appeventic
Copy link

appeventic commented Jan 9, 2024

Describe the bug
Android app is not getting correct deeplink from Branch when app is already opened. If I try to open multiple deeplinks Branch sending random deeplinks. This issue is only happening in Android and so far I didn't notice any issue in iOS. Also can’t repro this issue when launching the app from VS Code for debugging, but if I use build from the play store then can repro it.

To Reproduce

  1. Integrate ^7.0.2 of the package
  2. Initialize Branch SDK in the main.dart using
  await FlutterBranchSdk.init(
    useTestKey: false,
    enableLogging: false,
    disableTracking: false,
  );
  1. Listen to Branch session using -
  Future<void> listenDeepLinkData() async {
    _streamSubscriptionDeepLink = FlutterBranchSdk.listSession().listen((data) {
      if (data.containsKey(AppConstants.clickedBranchLink) &&
          data[AppConstants.clickedBranchLink] == true) {
        _firebaseAnalyticsService.logBranchData(data);
        var path = "";
        if (data.containsKey(AppConstants.deeplinkPath)) {
          path = data[AppConstants.deeplinkPath];
        }

        final arguments = _retrieveArguments(data);
        if (arguments != null && !path.isNullOrEmpty()) {
          _navigationService.navigateTo(path, arguments: arguments);
        }
      }
    }, onError: (error) {
      // TODO logging
    });
  }
  1. Made necessary changes in the AndroidManifest.xml as explained here - https://help.branch.io/developers-hub/docs/flutter-sdk-basic-integration
  2. Install the app
  3. Once app is open try to open different branch links
  4. Branch SDK returning random deeplinks when multiple deeplinks are clicked in a few seconds inerval

Expected behavior
When app is already opened, app should receive the correct deeplink from Branch SDK.

Smartphone (Please complete the following information. remove session if not platform):
Android OnePlus 8T, OS 13
Flutter Version: Flutter (Channel stable, 3.13.1, on macOS 13.5.1 22G90 darwin-arm64, locale en-US)
flutter_branch_sdk: ^7.0.2

  • Additional context

Issue only reproducible in Android, iOS looks fine.

@appeventic appeventic added the bug Something isn't working label Jan 9, 2024
@RodrigoSMarques
Copy link
Owner

I didn't understand.

"Branch SDK returning random deeplinks when multiple deeplinks are clicked in a few seconds innerval"

Is this an expected scenario? Too many clicks? at intervals of how long?

Can you send a video demonstrating the problem?

@appeventic
Copy link
Author

appeventic commented Jan 10, 2024

@RodrigoSMarques thanks for looking into it.

Screen recording: https://drive.google.com/file/d/1lzX4gY5mi0Ee868JFm6Z9U6zJvU461OK/view?usp=sharing

I think the issue is - let's say there are 3 deeplinks A, B and C. If the app is already in the background and if I tap on link A it just opens the app but app not getting the exact deeplink. Now if I tap on the deeplink B, Branch is returning deeplink A. Now if I tap on C, app is getting B from Branch.

@appeventic
Copy link
Author

@RodrigoSMarques thanks for your help, could you please help how we can fix it?

@RodrigoSMarques
Copy link
Owner

@appeventic

I was unable to reproduce the issue.

I recorded the attached video, carrying out tests with the example application and there were no problems recovering data from the links.

https://drive.google.com/file/d/1v9usGt1brmH8AvsbvsZD1rGoVTXIGIxA/view?usp=sharing

I have included a timestamp in the link data to identify the correct retrieval.

What does the below line of code do? It cannot be causing any delay in your application

_firebaseAnalyticsService.logBranchData(data);

@RodrigoSMarques
Copy link
Owner

@appeventic

Did you identify something in your code?

@nzackoya
Copy link

nzackoya commented Feb 8, 2024

Same here, but doesn't work only on the release mode

@appeventic
Copy link
Author

Same here, but doesn't work only on the release mode

+1 to this and thank God I thought only I'm facing this issue. @RodrigoSMarques this issue is a consistent repro if you test using a released version of the app which is already in Google play store. If possible could you please upload your test app in Google play store and try from that?

@nzackoya
Copy link

nzackoya commented Feb 9, 2024

Same here, but doesn't work only on the release mode

+1 to this and thank God I thought only I'm facing this issue. @RodrigoSMarques this issue is a consistent repro if you test using a released version of the app which is already in Google play store. If possible could you please upload your test app in Google play store and try from that?

Yeah, tried , didn't work the release beta from google play store. Simply downgraded to 6.9.0, until they fix the issue

@MrLightful
Copy link

MrLightful commented Feb 10, 2024

I am not sure yet about "links A, B, C" stuff, but I noticed that indeed sometimes links with data on android aren't being tracked, when app is open. They do work when clicking with app closed. On iOS it's not the issue, so I assume the listener is setup correctly in flutter code. So either android config is broken, or the problem in plugin/branch.io internals.

@RodrigoSMarques
Copy link
Owner

Same here, but doesn't work only on the release mode

Have you completed SHA256 Cert Fingerprints on the dashboard?

@MrLightful
Copy link

Have you completed SHA256 Cert Fingerprints on the dashboard?

Yep, Android App Links work as intended, without browser redirection. Google Play verified the domains and their assetlinks.json. I checked manually, fingerprints are there as well.

@RodrigoSMarques
Copy link
Owner

+1 to this and thank God I thought only I'm facing this issue. @RodrigoSMarques this issue is a consistent repro if you test using a released version of the app which is already in Google play store. If possible could you please upload your test app in Google play store and try from that?

I'm working on another app to upload to the store and test.

This plugin is just a layer with the Native SDK. It is difficult to identify whether the problem is in any call in the plugin or in the SDK under any specific conditions.

@RodrigoSMarques
Copy link
Owner

Yeah, tried , didn't work the release beta from google play store. Simply downgraded to 6.9.0, until they fix the issue

@nzackoya
I didn't understand. What beta version? Which version of the plugin were you using?

@RodrigoSMarques
Copy link
Owner

Have you completed SHA256 Cert Fingerprints on the dashboard?

Yep, Android App Links work as intended, without browser redirection. Google Play verified the domains and their assetlinks.json. I checked manually, fingerprints are there as well.

The question was for @nzackoya

I don't understand what your case @romatallinn

@nzackoya
Copy link

nzackoya commented Mar 5, 2024

@RodrigoSMarques I was replying to romatallinn's question. For you this one #283 (comment)

@MrLightful
Copy link

MrLightful commented Mar 5, 2024

I see lot of confusion in this thread of who replies to what haha. 😅


Just to wrap up what was wrong in my setup. Maybe will be helpful to somebody.

Android's launchMode

It's sort of a non-trivial concept in android, so hard to explain in short. My app does a lot of stuff via WhatsApp. By default, Flutter uses singleTop. And what happened, in very simplified words, is that while the app was already opened, clicking the branch link in WhatsApp would create a new instance of the app running within WhatsApp. So there were "2 app instances running" at the same time. And the branch link would be processed by a wrong one. And so it was behaving not as intended. Changing launchMode to singleTask instead, helped to clear stuff out. So there is only one app instance at any given moment. Again, very messy concept. Just try setting launchMode to singleTask and see if it helps.

Bug in initialization

Sort of a more of a trivial bug on my side. I have a splash screen with some setup and initialisation procedures. And branch init ended up being in a clause that aren't awaited completion, so they can be loaded in background even after splash screen. But the branch listener was right after the splash. So sometimes -- not always -- the branch wasn't init'ed at the moment of starting listening to links, so the ones used in opening the app were missed. Just ensuring that branch init is completed before starting the listener helped.

@DeekanshuSaini
Copy link

DeekanshuSaini commented Mar 29, 2024

@RodrigoSMarques I am using flutter_branch_io : 6.9.0 , and in my ios app it is working fine when in clicked on the link , but on android when the app is already opened and then i click on the link it opens another window of the same app but gives the data on the previous window (on Pixel 6a).

@RodrigoSMarques
Copy link
Owner

@RodrigoSMarques I am using flutter_branch_io : 6.9.0 , and in my ios app it is working fine when in clicked on the link , but on android when the app is already opened and then i click on the link it opens another window of the same app but gives the data on the previous window (on Pixel 6a).

You must update your AndroidManifest.xml `android:launchMode="singleTask"``

The previous answer is the explanation of this.

@shorben07
Copy link

I had similar issue. When tap on the link and app is running in background then the app correctly is being brought to foreground but navigation does not happen.

I did some investigation and noticed that following warning appear only on release builds

Play Store advertising service not found. If not expected, import com.google.android.gms.ads.identifier.AdvertisingIdClient into your gradle dependencies

It turned out I forgot to configure one of the steps related to pro guard https://help.branch.io/developers-hub/docs/android-basic-integration#7-configure-proguard

After applying ProGuard rules my android app now open links correctly from background state. I am pretty sure that there is race condition somewhere in FlutterBranchSDK and/or BranchSDK, so proguard configuration rather hides symptoms not fixing the real issue

@MrLightful
Copy link

MrLightful commented Apr 3, 2024

Tbh, I still have some problems. I cannot reproduce it myself. Tried different phones, android versions, emulator. It is always working fine for me. But some of our users have this behaviour, when the app is brought to focus, but the link is not detected. I don't know if it's the problem of the package, or branch io native implementations. No issues caught by Sentry. I logged some things manually to see how the code flows: when the app is opened, the listener reads empty { "+clicked_branch_link": "false", "+is_first_session": "false" }, when it should be the clicked link data. Again, it is not a consistent issue; I cannot reproduce it; I don't have any properties in mind (eg android version or phone model) that could cause it; but the problem exists.


@shorben07 I do have proguard config, which doesn't help me at the moment, but I copied it over from example project here, not branch docs. And I just noticed that there is a difference with what branch io dictates.
In example project of flutter_branch_sdk: -keep class com.google.android.gms.* {*;}
branch.io docs: -keep class com.google.android.gms.** {*;}

Note gms.* vs gms.**. I'm not experienced with proguard, but I assume it does make a difference. @RodrigoSMarques any thoughts?

I will try changing it and see if it helps.

@MrLightful
Copy link

@shorben07 can you please share your current proguard? Is it just one line that official branch docs says:
-keep class com.google.android.gms.** {*;}

or something else?

@shorben07
Copy link

My proguard is:

-keep class androidx.lifecycle.DefaultLifecycleObserver
-keep class com.google.android.gms.** { *; }

In my case I had issue probably because I have three different packages for deep links working side by side:

I already fixed something similar for iOS joylabs@c824d3f where Dynamic Links SDK breaks logic of Branch SDK Plugin and also only in release mode.

@shorben07
Copy link

Here are logs from my app:
Debug where everything works correctly:

2024-04-03 15:54:21.763  7795-7795  BranchSDK               com.memohq                           V  onActivityPaused, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:22.482  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onActivityStopped
2024-04-03 15:54:22.483  7795-7795  BranchSDK               com.memohq                           V  onActivityStopped, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.111  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onActivityStarted
2024-04-03 15:54:27.111  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered SessionBuilder init
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  InitSessionBuilder setting BranchReferralInitListener withCallback with br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  InitSessionBuilder setting withData with https://lk.memo.com/k7THue0ouIb
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  Beginning session initialization
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  Session uri is https://lk.memo.com/k7THue0ouIb
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Callback is br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Is auto init false
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Will ignore intent null
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Is reinitializing false
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:54:27.114  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:54:27.114  7795-7795  BranchSDK               com.memohq                           V  isInstantDeepLinkPossible false
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           D  Creating io.branch.referral.ServerRequestRegisterOpen@3ec53d7 from init on thread main
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  initializeSession io.branch.referral.ServerRequestRegisterOpen@3ec53d7 delay 0
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  Intent: Intent { act=android.intent.action.VIEW dat=https://lk.memo.com/... flg=0x10400000 cmp=com.memohq/.MainActivity (has extras) } forceBranchSession: false initState: UNINITIALISED
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  registerAppInit io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  Ordering init calls
2024-04-03 15:54:27.133  7795-7795  BranchSDK               com.memohq                           V  Queue is: 
2024-04-03 15:54:27.133  7795-7795  BranchSDK               com.memohq                           V  Moving io.branch.referral.ServerRequestRegisterOpen@3ec53d7  to front of the queue or behind network-in-progress request
2024-04-03 15:54:27.137  7795-7795  BranchSDK               com.memohq                           V  Finished ordering init calls
2024-04-03 15:54:27.138  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks []
2024-04-03 15:54:27.138  7795-7795  BranchSDK               com.memohq                           V  initTasks io.branch.referral.ServerRequestRegisterOpen@3ec53d7 ignoreWaitLocks false
2024-04-03 15:54:27.139  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem registerAppInit
2024-04-03 15:54:27.139  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks [GAID_FETCH_WAIT_LOCK]
2024-04-03 15:54:27.139  7795-7795  BranchSDK               com.memohq                           D  processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.140  7795-7795  BranchSDK               com.memohq                           V  onActivityStarted, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.148  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onNewIntent
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  onActivityResumed, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  onIntentReady com.memohq.MainActivity@79f40fd removing INTENT_PENDING_WAIT_LOCK
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.159  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:54:27.162  7795-7795  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.162  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:54:27.163  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:54:27.165  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem onIntentReady
2024-04-03 15:54:27.166  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks [GAID_FETCH_WAIT_LOCK]
2024-04-03 15:54:27.166  7795-7795  BranchSDK               com.memohq                           D  processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.280  7795-7902  BranchSDK               com.memohq                           V  processNextQueueItem onAdsParamsFetchFinished
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks []
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           D  processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  executeTimedBranchPostTask io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  callback to be returned br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  onPreExecute io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.287  7795-7902  BranchSDK               com.memohq                           V  Current referringURLQueryParameters: {}
2024-04-03 15:54:27.289  7795-7932  BranchSDK               com.memohq                           V  Beginning rest post for io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.295  7795-7932  BranchSDK               com.memohq                           V  posting to https://api2.branch.io/v1/open
2024-04-03 15:54:27.314  7795-7932  BranchSDK               com.memohq                           V  Post value = {"randomized_device_token":"1273930861649215144","randomized_bundle_token":"1304047432174343446","hardware_id":"07d57ab6-5c77-4372-b79f-0e5aed167b33","is_hardware_id_real":false,"anon_id":"668468e0-cab9-4478-9db4-09d878670124","brand":"Xiaomi","model":"M2101K6G","screen_dpi":440,"screen_height":2177,"screen_width":1080,"wifi":true,"ui_mode":"UI_MODE_TYPE_NORMAL","os":"Android","os_version":30,"plugin_name":"Flutter","plugin_version":"7.0.4","country":"US","language":"en","local_ip":"192.0.0.4","cpu_type":"aarch64","build":"RKQ1.200826.002 test-keys","locale":"en_US","connection_type":"wifi","os_version_android":"11","debug":false,"partner_data":{},"app_version":"1.22.0","initial_referrer":"android-app:\/\/com.android.shell","update":1,"latest_install_time":1712147345442,"latest_update_time":1712148651715,"first_install_time":1712147345442,"previous_update_time":1712147766923,"environment":"FULL_APP","android_app_link_url":"https:\/\/lk.memo.com\/k7THue0ouIb","external_intent_uri":"https:\/\/lk.memo.com\/k7THue0ouIb","metadata":{},"app_store":"PlayStore","advertising_ids":{"aaid":"9b3e86ce-8910-4368-abd8-3c55ded19fdd"},"lat_val":0,"google_advertising_id":"9b3e86ce-8910-4368-abd8-3c55ded19fdd","instrumentation":{"v1\/open-brtt":"527"},"sdk":"android5.11.0","branch_key":"key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv"}
2024-04-03 15:54:27.681  7795-7932  BranchSDK               com.memohq                           D  lastResponseMessage OK
2024-04-03 15:54:27.692  7795-7932  BranchSDK               com.memohq                           V  Branch Networking Success
                                                                                                    URL: https://api2.branch.io/v1/open
                                                                                                    Response Code: 200
                                                                                                    Response Message: OK
                                                                                                    Retry number: 0
                                                                                                    requestId: a7a8f6fe-5ad4-462a-b547-4cdfb68cd196-2024040312
                                                                                                    Object: io.branch.referral.network.BranchRemoteInterfaceUrlConnection@52a4f33
2024-04-03 15:54:27.694  7795-7932  BranchSDK               com.memohq                           V  Server returned: [a7a8f6fe-5ad4-462a-b547-4cdfb68cd196-2024040312] Status: [200]; Data: {"data":"{\"+match_guaranteed\":true,\"$og_title\":\"Memo — Be Heard\",\"$desktop_url\":\"https://app.memo.com/i/i-JWKezO9fT-agMfWlLvdGwQ\",\"~creation_source\":0,\"+clicked_branch_link\":true,\"$og_description\":\"Memo believes everyone deserves to be heard and understood. We offer a stage to the 90% of people on social media who go unnoticed, drowned out by \\\"trending\\\" posts and ads.\",\"+click_timestamp\":1712148867,\"~id\":1303979370737835712,\"$canonical_url\":\"https://app.memo.com/i/i-JWKezO9fT-agMfWlLvdGwQ\",\"+is_first_session\":false,\"~referring_link\":\"https://lk.memo.com/k7THue0ouIb\",\"$og_type\":\"website\"}","link":"https://lk.memo.com/a/key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv?%24randomized_bundle_token=1304047432174343446","randomized_bundle_token":"1304047432174343446","randomized_device_token":"1273930861649215144","session_id":"1304053743201109598","session_link_click_id":"1304053743184371660"}
2024-04-03 15:54:27.696  7795-7795  BranchSDK               com.memohq                           V  onPostExecuteInner io.branch.referral.ServerRequestQueue$BranchPostTask@5a04765 io.branch.referral.ServerResponse@81d5c3a
2024-04-03 15:54:27.697  7795-7795  BranchSDK               com.memohq                           V  onRequestSuccess io.branch.referral.ServerResponse@81d5c3a
2024-04-03 15:54:27.699  7795-7795  BranchSDK               com.memohq                           V  Does not have Clicked_Branch_Link or Clicked_Branch_Link is false, returning
2024-04-03 15:54:27.699  7795-7795  BranchSDK               com.memohq                           V  postInitClear io.branch.referral.PrefHelper@bfe9aee can clear init data true
2024-04-03 15:54:27.704  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem unlockSDKInitWaitLock
2024-04-03 15:54:27.704  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks []
2024-04-03 15:54:27.705  7795-7795  BranchSDK               com.memohq                           V  onRequestSucceeded io.branch.referral.ServerRequestRegisterOpen@3ec53d7 io.branch.referral.ServerResponse@81d5c3a on callback br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.706  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onInitFinished
2024-04-03 15:54:27.708  7795-7795  FlutterBranchSDK        com.memohq                           D  BranchReferralInitListener - params: {"+match_guaranteed":true,"$og_title":"Memo — Be Heard","$desktop_url":"https:\/\/app.memo.com\/i\/i-JWKezO9fT-agMfWlLvdGwQ","~creation_source":0,"+clicked_branch_link":true,"$og_description":"Memo believes everyone deserves to be heard and understood. We offer a stage to the 90% of people on social media who go unnoticed, drowned out by \"trending\" posts and ads.","+click_timestamp":1712148867,"~id":1303979370737835712,"$canonical_url":"https:\/\/app.memo.com\/i\/i-JWKezO9fT-agMfWlLvdGwQ","+is_first_session":false,"~referring_link":"https:\/\/lk.memo.com\/k7THue0ouIb","$og_type":"website"}
2024-04-03 15:54:27.711  7795-7795  BranchSDK               com.memohq                           V  Deferring userAgent string call for sync retrieval
2024-04-03 15:54:27.711  7795-7795  BranchSDK               com.memohq                           V  onInitSessionCompleted on thread main
2024-04-03 15:54:27.714  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem onPostExecuteInner
2024-04-03 15:54:27.714  7795-7795  BranchSDK               com.memohq                           V  Queue is: 

Release mode where navigation does not happen

2024-04-03 15:36:48.211  6533-6533  BranchSDK               com.memohq                           V  onActivityPaused, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:48.840  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onActivityStopped
2024-04-03 15:36:48.841  6533-6533  BranchSDK               com.memohq                           V  onActivityStopped, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:53.684  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onActivityStarted
2024-04-03 15:36:53.684  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered SessionBuilder init
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  InitSessionBuilder setting BranchReferralInitListener withCallback with S.b$k@2e69325
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  InitSessionBuilder setting withData with https://lk.memo.com/k7THue0ouIb
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Beginning session initialization
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Session uri is https://lk.memo.com/k7THue0ouIb
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Callback is S.b$k@2e69325
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Is auto init false
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Will ignore intent null
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Is reinitializing false
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@690efee
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@690efee
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isInstantDeepLinkPossible false
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           D  Creating M4.K@496218b from init on thread main
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  initializeSession M4.K@496218b delay 0
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  Intent: Intent { act=android.intent.action.VIEW dat=https://lk.memo.com/... flg=0x10400000 cmp=com.memohq/.MainActivity (has extras) } forceBranchSession: false initState: UNINITIALISED
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  registerAppInit M4.K@496218b
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  Ordering init calls
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  Queue is: 
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Moving M4.K@496218b  to front of the queue or behind network-in-progress request
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Finished ordering init calls
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  initTasks M4.K@496218b ignoreWaitLocks false
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Could not find com.google.android.gms.ads.identifier.AdvertisingIdClient. If expected, import the dependency into your app.
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem onAdsParamsFetchFinished
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           D  processNextQueueItem, req M4.K@496218b
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  executeTimedBranchPostTask M4.K@496218b
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  callback to be returned S.b$k@2e69325
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  onPreExecute M4.K@496218b
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Current referringURLQueryParameters: {}
2024-04-03 15:36:53.689  6533-6666  BranchSDK               com.memohq                           V  Beginning rest post for M4.K@496218b
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  Play Store advertising service not found. If not expected, import com.google.android.gms.ads.identifier.AdvertisingIdClient into your gradle dependencies
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem registerAppInit
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  onActivityStarted, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:53.689  6533-6666  BranchSDK               com.memohq                           V  posting to https://api2.branch.io/v1/open
2024-04-03 15:36:53.689  6533-6666  BranchSDK               com.memohq                           V  Post value = {"randomized_device_token":"1273930861649215144","randomized_bundle_token":"1304047432174343446","hardware_id":"51b16239ddba2655","is_hardware_id_real":true,"anon_id":"668468e0-cab9-4478-9db4-09d878670124","brand":"Xiaomi","model":"M2101K6G","screen_dpi":440,"screen_height":2177,"screen_width":1080,"wifi":true,"ui_mode":"UI_MODE_TYPE_NORMAL","os":"Android","os_version":30,"plugin_name":"Flutter","plugin_version":"7.0.4","country":"US","language":"en","local_ip":"192.0.0.4","cpu_type":"aarch64","build":"RKQ1.200826.002 test-keys","locale":"en_US","connection_type":"wifi","os_version_android":"11","debug":false,"partner_data":{},"app_version":"1.22.0","initial_referrer":"android-app:\/\/com.android.shell","update":1,"latest_install_time":1712147345442,"latest_update_time":1712147766923,"first_install_time":1712147345442,"previous_update_time":1712147345442,"environment":"FULL_APP","metadata":{},"app_store":"PlayStore","lat_val":0,"instrumentation":{"v1\/open-brtt":"345"},"sdk":"android5.11.0","branch_key":"key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv"}
2024-04-03 15:36:53.690  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onNewIntent
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  onActivityResumed, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  onIntentReady com.memohq.MainActivity@690efee removing INTENT_PENDING_WAIT_LOCK
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@690efee
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@690efee
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem onIntentReady
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:54.010  6533-6666  BranchSDK               com.memohq                           D  lastResponseMessage OK
2024-04-03 15:36:54.010  6533-6666  BranchSDK               com.memohq                           V  Branch Networking Success
                                                                                                    URL: https://api2.branch.io/v1/open
                                                                                                    Response Code: 200
                                                                                                    Response Message: OK
                                                                                                    Retry number: 0
                                                                                                    requestId: abca4568-0da4-4a6f-9460-fa7b900c22e5-2024040312
                                                                                                    Object: O4.b@34e2635
2024-04-03 15:36:54.011  6533-6666  BranchSDK               com.memohq                           V  Server returned: [abca4568-0da4-4a6f-9460-fa7b900c22e5-2024040312] Status: [200]; Data: {"data":"{\"+clicked_branch_link\":false,\"+is_first_session\":false}","link":"https://lk.memo.com/a/key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv?%24randomized_bundle_token=1304047432174343446","randomized_bundle_token":"1304047432174343446","randomized_device_token":"1273930861649215144","session_id":"1304049323927092019"}
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  onPostExecuteInner M4.I$b@daf8680 M4.L@5b774b9
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  onRequestSuccess M4.L@5b774b9
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  Does not have Clicked_Branch_Link or Clicked_Branch_Link is false, returning
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  postInitClear M4.B@9351758 can clear init data true
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem unlockSDKInitWaitLock
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  onRequestSucceeded M4.K@496218b M4.L@5b774b9 on callback S.b$k@2e69325
2024-04-03 15:36:54.012  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onInitFinished
2024-04-03 15:36:54.012  6533-6533  FlutterBranchSDK        com.memohq                           D  BranchReferralInitListener - params: {"+clicked_branch_link":false,"+is_first_session":false}
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  Deferring userAgent string call for sync retrieval
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  onInitSessionCompleted on thread main
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem onPostExecuteInner
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  Queue is: 
2024-04-03 15:41:53.956  6533-6533  BranchSDK               com.memohq                           V  onActivityPaused, activity = com.memohq.MainActivity@690efee
2024-04-03 15:41:53.994  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onActivityStopped
2024-04-03 15:41:53.995  6533-6533  BranchSDK               com.memohq                           V  onActivityStopped, activity = com.memohq.MainActivity@690efee

As you can see no exceptions or errors, so that is why you don't see anything in the Sentry but in the end you get

BranchReferralInitListener - params: {"+clicked_branch_link":false,"+is_first_session":false}

@RodrigoSMarques
Copy link
Owner

Tbh, I still have some problems. I cannot reproduce it myself. Tried different phones, android versions, emulator. It is always working fine for me. But some of our users have this behaviour, when the app is brought to focus, but the link is not detected. I don't know if it's the problem of the package, or branch io native implementations. No issues caught by Sentry. I logged some things manually to see how the code flows: when the app is opened, the listener reads empty { "+clicked_branch_link": "false", "+is_first_session": "false" }, when it should be the clicked link data. Again, it is not a consistent issue; I cannot reproduce it; I don't have any properties in mind (eg android version or phone model) that could cause it; but the problem exists.

@shorben07 I do have proguard config, which doesn't help me at the moment, but I copied it over from example project here, not branch docs. And I just noticed that there is a difference with what branch io dictates. In example project of flutter_branch_sdk: -keep class com.google.android.gms.* {*;} branch.io docs: -keep class com.google.android.gms.** {*;}

Note gms.* vs gms.**. I'm not experienced with proguard, but I assume it does make a difference. @RodrigoSMarques any thoughts?

I will try changing it and see if it helps.

The example project's proguard settings may be outdated and inconsistent.

Use the instructions recommended by Branch.

I don't have experience with pro-guard to know if there is a difference in syntax.

@RodrigoSMarques
Copy link
Owner

RodrigoSMarques commented Apr 4, 2024

My proguard is:

-keep class androidx.lifecycle.DefaultLifecycleObserver
-keep class com.google.android.gms.** { *; }

In my case I had issue probably because I have three different packages for deep links working side by side:

I already fixed something similar for iOS joylabs@c824d3f where Dynamic Links SDK breaks logic of Branch SDK Plugin and also only in release mode.

This solution is interesting.

I will add a new method in the plugin to configure hosts that should be ignored by the SDK.

I believe this solves the problem of this issue here: #296

@shorben07

Why did you add the line below?

-keep class androidx.lifecycle.DefaultLifecycleObserver

This library is used by the plugin to monitor Activity state changes.

It is responsible for notifying the SDK that the application has moved to the foreground and thus recovering the data from the clicked link.

@RodrigoSMarques
Copy link
Owner

Here are logs from my app: Debug where everything works correctly:

2024-04-03 15:54:21.763  7795-7795  BranchSDK               com.memohq                           V  onActivityPaused, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:22.482  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onActivityStopped
2024-04-03 15:54:22.483  7795-7795  BranchSDK               com.memohq                           V  onActivityStopped, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.111  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onActivityStarted
2024-04-03 15:54:27.111  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered SessionBuilder init
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  InitSessionBuilder setting BranchReferralInitListener withCallback with br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  InitSessionBuilder setting withData with https://lk.memo.com/k7THue0ouIb
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  Beginning session initialization
2024-04-03 15:54:27.111  7795-7795  BranchSDK               com.memohq                           V  Session uri is https://lk.memo.com/k7THue0ouIb
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Callback is br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Is auto init false
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Will ignore intent null
2024-04-03 15:54:27.112  7795-7795  BranchSDK               com.memohq                           V  Is reinitializing false
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.113  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:54:27.114  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:54:27.114  7795-7795  BranchSDK               com.memohq                           V  isInstantDeepLinkPossible false
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           D  Creating io.branch.referral.ServerRequestRegisterOpen@3ec53d7 from init on thread main
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  initializeSession io.branch.referral.ServerRequestRegisterOpen@3ec53d7 delay 0
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  Intent: Intent { act=android.intent.action.VIEW dat=https://lk.memo.com/... flg=0x10400000 cmp=com.memohq/.MainActivity (has extras) } forceBranchSession: false initState: UNINITIALISED
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  registerAppInit io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.132  7795-7795  BranchSDK               com.memohq                           V  Ordering init calls
2024-04-03 15:54:27.133  7795-7795  BranchSDK               com.memohq                           V  Queue is: 
2024-04-03 15:54:27.133  7795-7795  BranchSDK               com.memohq                           V  Moving io.branch.referral.ServerRequestRegisterOpen@3ec53d7  to front of the queue or behind network-in-progress request
2024-04-03 15:54:27.137  7795-7795  BranchSDK               com.memohq                           V  Finished ordering init calls
2024-04-03 15:54:27.138  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks []
2024-04-03 15:54:27.138  7795-7795  BranchSDK               com.memohq                           V  initTasks io.branch.referral.ServerRequestRegisterOpen@3ec53d7 ignoreWaitLocks false
2024-04-03 15:54:27.139  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem registerAppInit
2024-04-03 15:54:27.139  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks [GAID_FETCH_WAIT_LOCK]
2024-04-03 15:54:27.139  7795-7795  BranchSDK               com.memohq                           D  processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.140  7795-7795  BranchSDK               com.memohq                           V  onActivityStarted, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.148  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onNewIntent
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  onActivityResumed, activity = com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  onIntentReady com.memohq.MainActivity@79f40fd removing INTENT_PENDING_WAIT_LOCK
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:54:27.158  7795-7795  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.159  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:54:27.162  7795-7795  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@79f40fd
2024-04-03 15:54:27.162  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:54:27.163  7795-7795  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:54:27.165  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem onIntentReady
2024-04-03 15:54:27.166  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks [GAID_FETCH_WAIT_LOCK]
2024-04-03 15:54:27.166  7795-7795  BranchSDK               com.memohq                           D  processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.280  7795-7902  BranchSDK               com.memohq                           V  processNextQueueItem onAdsParamsFetchFinished
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks []
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           D  processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  executeTimedBranchPostTask io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  callback to be returned br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.281  7795-7902  BranchSDK               com.memohq                           V  onPreExecute io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.287  7795-7902  BranchSDK               com.memohq                           V  Current referringURLQueryParameters: {}
2024-04-03 15:54:27.289  7795-7932  BranchSDK               com.memohq                           V  Beginning rest post for io.branch.referral.ServerRequestRegisterOpen@3ec53d7
2024-04-03 15:54:27.295  7795-7932  BranchSDK               com.memohq                           V  posting to https://api2.branch.io/v1/open
2024-04-03 15:54:27.314  7795-7932  BranchSDK               com.memohq                           V  Post value = {"randomized_device_token":"1273930861649215144","randomized_bundle_token":"1304047432174343446","hardware_id":"07d57ab6-5c77-4372-b79f-0e5aed167b33","is_hardware_id_real":false,"anon_id":"668468e0-cab9-4478-9db4-09d878670124","brand":"Xiaomi","model":"M2101K6G","screen_dpi":440,"screen_height":2177,"screen_width":1080,"wifi":true,"ui_mode":"UI_MODE_TYPE_NORMAL","os":"Android","os_version":30,"plugin_name":"Flutter","plugin_version":"7.0.4","country":"US","language":"en","local_ip":"192.0.0.4","cpu_type":"aarch64","build":"RKQ1.200826.002 test-keys","locale":"en_US","connection_type":"wifi","os_version_android":"11","debug":false,"partner_data":{},"app_version":"1.22.0","initial_referrer":"android-app:\/\/com.android.shell","update":1,"latest_install_time":1712147345442,"latest_update_time":1712148651715,"first_install_time":1712147345442,"previous_update_time":1712147766923,"environment":"FULL_APP","android_app_link_url":"https:\/\/lk.memo.com\/k7THue0ouIb","external_intent_uri":"https:\/\/lk.memo.com\/k7THue0ouIb","metadata":{},"app_store":"PlayStore","advertising_ids":{"aaid":"9b3e86ce-8910-4368-abd8-3c55ded19fdd"},"lat_val":0,"google_advertising_id":"9b3e86ce-8910-4368-abd8-3c55ded19fdd","instrumentation":{"v1\/open-brtt":"527"},"sdk":"android5.11.0","branch_key":"key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv"}
2024-04-03 15:54:27.681  7795-7932  BranchSDK               com.memohq                           D  lastResponseMessage OK
2024-04-03 15:54:27.692  7795-7932  BranchSDK               com.memohq                           V  Branch Networking Success
                                                                                                    URL: https://api2.branch.io/v1/open
                                                                                                    Response Code: 200
                                                                                                    Response Message: OK
                                                                                                    Retry number: 0
                                                                                                    requestId: a7a8f6fe-5ad4-462a-b547-4cdfb68cd196-2024040312
                                                                                                    Object: io.branch.referral.network.BranchRemoteInterfaceUrlConnection@52a4f33
2024-04-03 15:54:27.694  7795-7932  BranchSDK               com.memohq                           V  Server returned: [a7a8f6fe-5ad4-462a-b547-4cdfb68cd196-2024040312] Status: [200]; Data: {"data":"{\"+match_guaranteed\":true,\"$og_title\":\"Memo — Be Heard\",\"$desktop_url\":\"https://app.memo.com/i/i-JWKezO9fT-agMfWlLvdGwQ\",\"~creation_source\":0,\"+clicked_branch_link\":true,\"$og_description\":\"Memo believes everyone deserves to be heard and understood. We offer a stage to the 90% of people on social media who go unnoticed, drowned out by \\\"trending\\\" posts and ads.\",\"+click_timestamp\":1712148867,\"~id\":1303979370737835712,\"$canonical_url\":\"https://app.memo.com/i/i-JWKezO9fT-agMfWlLvdGwQ\",\"+is_first_session\":false,\"~referring_link\":\"https://lk.memo.com/k7THue0ouIb\",\"$og_type\":\"website\"}","link":"https://lk.memo.com/a/key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv?%24randomized_bundle_token=1304047432174343446","randomized_bundle_token":"1304047432174343446","randomized_device_token":"1273930861649215144","session_id":"1304053743201109598","session_link_click_id":"1304053743184371660"}
2024-04-03 15:54:27.696  7795-7795  BranchSDK               com.memohq                           V  onPostExecuteInner io.branch.referral.ServerRequestQueue$BranchPostTask@5a04765 io.branch.referral.ServerResponse@81d5c3a
2024-04-03 15:54:27.697  7795-7795  BranchSDK               com.memohq                           V  onRequestSuccess io.branch.referral.ServerResponse@81d5c3a
2024-04-03 15:54:27.699  7795-7795  BranchSDK               com.memohq                           V  Does not have Clicked_Branch_Link or Clicked_Branch_Link is false, returning
2024-04-03 15:54:27.699  7795-7795  BranchSDK               com.memohq                           V  postInitClear io.branch.referral.PrefHelper@bfe9aee can clear init data true
2024-04-03 15:54:27.704  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem unlockSDKInitWaitLock
2024-04-03 15:54:27.704  7795-7795  BranchSDK               com.memohq                           V  Queue is: io.branch.referral.ServerRequestRegisterOpen@3ec53d7 with locks []
2024-04-03 15:54:27.705  7795-7795  BranchSDK               com.memohq                           V  onRequestSucceeded io.branch.referral.ServerRequestRegisterOpen@3ec53d7 io.branch.referral.ServerResponse@81d5c3a on callback br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@2ff6d00
2024-04-03 15:54:27.706  7795-7795  FlutterBranchSDK        com.memohq                           D  triggered onInitFinished
2024-04-03 15:54:27.708  7795-7795  FlutterBranchSDK        com.memohq                           D  BranchReferralInitListener - params: {"+match_guaranteed":true,"$og_title":"Memo — Be Heard","$desktop_url":"https:\/\/app.memo.com\/i\/i-JWKezO9fT-agMfWlLvdGwQ","~creation_source":0,"+clicked_branch_link":true,"$og_description":"Memo believes everyone deserves to be heard and understood. We offer a stage to the 90% of people on social media who go unnoticed, drowned out by \"trending\" posts and ads.","+click_timestamp":1712148867,"~id":1303979370737835712,"$canonical_url":"https:\/\/app.memo.com\/i\/i-JWKezO9fT-agMfWlLvdGwQ","+is_first_session":false,"~referring_link":"https:\/\/lk.memo.com\/k7THue0ouIb","$og_type":"website"}
2024-04-03 15:54:27.711  7795-7795  BranchSDK               com.memohq                           V  Deferring userAgent string call for sync retrieval
2024-04-03 15:54:27.711  7795-7795  BranchSDK               com.memohq                           V  onInitSessionCompleted on thread main
2024-04-03 15:54:27.714  7795-7795  BranchSDK               com.memohq                           V  processNextQueueItem onPostExecuteInner
2024-04-03 15:54:27.714  7795-7795  BranchSDK               com.memohq                           V  Queue is: 

Release mode where navigation does not happen

2024-04-03 15:36:48.211  6533-6533  BranchSDK               com.memohq                           V  onActivityPaused, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:48.840  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onActivityStopped
2024-04-03 15:36:48.841  6533-6533  BranchSDK               com.memohq                           V  onActivityStopped, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:53.684  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onActivityStarted
2024-04-03 15:36:53.684  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered SessionBuilder init
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  InitSessionBuilder setting BranchReferralInitListener withCallback with S.b$k@2e69325
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  InitSessionBuilder setting withData with https://lk.memo.com/k7THue0ouIb
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Beginning session initialization
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Session uri is https://lk.memo.com/k7THue0ouIb
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Callback is S.b$k@2e69325
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Is auto init false
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Will ignore intent null
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Is reinitializing false
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@690efee
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@690efee
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed true
2024-04-03 15:36:53.684  6533-6533  BranchSDK               com.memohq                           V  isInstantDeepLinkPossible false
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           D  Creating M4.K@496218b from init on thread main
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  initializeSession M4.K@496218b delay 0
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  Intent: Intent { act=android.intent.action.VIEW dat=https://lk.memo.com/... flg=0x10400000 cmp=com.memohq/.MainActivity (has extras) } forceBranchSession: false initState: UNINITIALISED
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  registerAppInit M4.K@496218b
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  Ordering init calls
2024-04-03 15:36:53.687  6533-6533  BranchSDK               com.memohq                           V  Queue is: 
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Moving M4.K@496218b  to front of the queue or behind network-in-progress request
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Finished ordering init calls
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  initTasks M4.K@496218b ignoreWaitLocks false
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Could not find com.google.android.gms.ads.identifier.AdvertisingIdClient. If expected, import the dependency into your app.
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem onAdsParamsFetchFinished
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           D  processNextQueueItem, req M4.K@496218b
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  executeTimedBranchPostTask M4.K@496218b
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  callback to be returned S.b$k@2e69325
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  onPreExecute M4.K@496218b
2024-04-03 15:36:53.688  6533-6533  BranchSDK               com.memohq                           V  Current referringURLQueryParameters: {}
2024-04-03 15:36:53.689  6533-6666  BranchSDK               com.memohq                           V  Beginning rest post for M4.K@496218b
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  Play Store advertising service not found. If not expected, import com.google.android.gms.ads.identifier.AdvertisingIdClient into your gradle dependencies
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem registerAppInit
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:53.689  6533-6533  BranchSDK               com.memohq                           V  onActivityStarted, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:53.689  6533-6666  BranchSDK               com.memohq                           V  posting to https://api2.branch.io/v1/open
2024-04-03 15:36:53.689  6533-6666  BranchSDK               com.memohq                           V  Post value = {"randomized_device_token":"1273930861649215144","randomized_bundle_token":"1304047432174343446","hardware_id":"51b16239ddba2655","is_hardware_id_real":true,"anon_id":"668468e0-cab9-4478-9db4-09d878670124","brand":"Xiaomi","model":"M2101K6G","screen_dpi":440,"screen_height":2177,"screen_width":1080,"wifi":true,"ui_mode":"UI_MODE_TYPE_NORMAL","os":"Android","os_version":30,"plugin_name":"Flutter","plugin_version":"7.0.4","country":"US","language":"en","local_ip":"192.0.0.4","cpu_type":"aarch64","build":"RKQ1.200826.002 test-keys","locale":"en_US","connection_type":"wifi","os_version_android":"11","debug":false,"partner_data":{},"app_version":"1.22.0","initial_referrer":"android-app:\/\/com.android.shell","update":1,"latest_install_time":1712147345442,"latest_update_time":1712147766923,"first_install_time":1712147345442,"previous_update_time":1712147345442,"environment":"FULL_APP","metadata":{},"app_store":"PlayStore","lat_val":0,"instrumentation":{"v1\/open-brtt":"345"},"sdk":"android5.11.0","branch_key":"key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv"}
2024-04-03 15:36:53.690  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onNewIntent
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  onActivityResumed, activity = com.memohq.MainActivity@690efee
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  onIntentReady com.memohq.MainActivity@690efee removing INTENT_PENDING_WAIT_LOCK
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  Read params uri: https://lk.memo.com/k7THue0ouIb bypassCurrentActivityIntentState: false intent state: READY
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  extractExternalUriAndIntentExtras https://lk.memo.com/k7THue0ouIb com.memohq.MainActivity@690efee
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:36:53.691  6533-6533  BranchSDK               com.memohq                           V  extractBranchLinkFromIntentExtra com.memohq.MainActivity@690efee
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  isIntentParamsAlreadyConsumed false
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem onIntentReady
2024-04-03 15:36:53.692  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:54.010  6533-6666  BranchSDK               com.memohq                           D  lastResponseMessage OK
2024-04-03 15:36:54.010  6533-6666  BranchSDK               com.memohq                           V  Branch Networking Success
                                                                                                    URL: https://api2.branch.io/v1/open
                                                                                                    Response Code: 200
                                                                                                    Response Message: OK
                                                                                                    Retry number: 0
                                                                                                    requestId: abca4568-0da4-4a6f-9460-fa7b900c22e5-2024040312
                                                                                                    Object: O4.b@34e2635
2024-04-03 15:36:54.011  6533-6666  BranchSDK               com.memohq                           V  Server returned: [abca4568-0da4-4a6f-9460-fa7b900c22e5-2024040312] Status: [200]; Data: {"data":"{\"+clicked_branch_link\":false,\"+is_first_session\":false}","link":"https://lk.memo.com/a/key_live_nEbtVG0NoMHbdmflepSYWcamwrjBv4nv?%24randomized_bundle_token=1304047432174343446","randomized_bundle_token":"1304047432174343446","randomized_device_token":"1273930861649215144","session_id":"1304049323927092019"}
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  onPostExecuteInner M4.I$b@daf8680 M4.L@5b774b9
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  onRequestSuccess M4.L@5b774b9
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  Does not have Clicked_Branch_Link or Clicked_Branch_Link is false, returning
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  postInitClear M4.B@9351758 can clear init data true
2024-04-03 15:36:54.011  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem unlockSDKInitWaitLock
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  Queue is: M4.K@496218b with locks []
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  onRequestSucceeded M4.K@496218b M4.L@5b774b9 on callback S.b$k@2e69325
2024-04-03 15:36:54.012  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onInitFinished
2024-04-03 15:36:54.012  6533-6533  FlutterBranchSDK        com.memohq                           D  BranchReferralInitListener - params: {"+clicked_branch_link":false,"+is_first_session":false}
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  Deferring userAgent string call for sync retrieval
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  onInitSessionCompleted on thread main
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  processNextQueueItem onPostExecuteInner
2024-04-03 15:36:54.012  6533-6533  BranchSDK               com.memohq                           V  Queue is: 
2024-04-03 15:41:53.956  6533-6533  BranchSDK               com.memohq                           V  onActivityPaused, activity = com.memohq.MainActivity@690efee
2024-04-03 15:41:53.994  6533-6533  FlutterBranchSDK        com.memohq                           D  triggered onActivityStopped
2024-04-03 15:41:53.995  6533-6533  BranchSDK               com.memohq                           V  onActivityStopped, activity = com.memohq.MainActivity@690efee

As you can see no exceptions or errors, so that is why you don't see anything in the Sentry but in the end you get

BranchReferralInitListener - params: {"+clicked_branch_link":false,"+is_first_session":false}

@shorben07

Checking your log, I see that Native SDK (BranchSDK) commands are the majority of the result.

The native SDK is responsible for identifying the links, retrieving the data and the Flutter plugin receives the result.

I suggest opening an issue in the Android repository, detailing your case and with the log for analysis.

@shorben07
Copy link

shorben07 commented Apr 4, 2024

@RodrigoSMarques

Why did you add the line below?

DefaultLifecycleObserver is unrelated to BranchSDK and was added earlier for some other plugin to work correctly. I posted the whole file with my proguard rules.

@RodrigoSMarques RodrigoSMarques added the under analysis need more analysis label Apr 7, 2024
@RodrigoSMarques
Copy link
Owner

Hi guys.

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.

@RodrigoSMarques
Copy link
Owner

Hey guys.

Version 8.0.0 released.

Take the tests and report the results.

@vasa137
Copy link

vasa137 commented May 18, 2024

Now, I cannot get any link when I open the app - since onInitFinished on Android side is not called at all.

See this ticket - #325

@RodrigoSMarques RodrigoSMarques added Waiting for Test Waiting for test results after release and removed under analysis need more analysis labels May 20, 2024
@RodrigoSMarques
Copy link
Owner

Closed. No activity/response in the last 15 days.
If necessary open again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for Test Waiting for test results after release
Projects
None yet
Development

No branches or pull requests

7 participants