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
395 stars 155 forks source link

Branch link does not providing correct data in the branch listener #1187

Closed aadityapaliwal closed 3 months ago

aadityapaliwal commented 3 months ago

Describe the bug

I have Branch integration in our app. It was working fine before couple of days but now suddenly it stopped working. Even it's working in the production app (Till Android 33) that went live couple of days back but on the QA.

I was also getting below error -

Warning. Session initialization already happened. To force a new session, set intent extra, "branch_force_new_session", to true.

To fix this issue, I have provided branch_force_new_session true in the intent.

Steps to reproduce

  1. Tap on the link
  2. Check the below logs from Branch. In the logs, it's saying server returned data which is correct but that data is not available on branch callback. If you check the last line that referringParams params I am getting on branch listener -
onNewIntent Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=xxxx://open/... flg=0x14400000 pkg=cc.xxxx.wallet cmp=cc.xxxx.wallet/com.xxxx.ui.MainActivity (has extras) }
onActivityResumed, activity = com.xxxx.ui.MainActivity@436e53c
onIntentReady com.xxxx.ui.MainActivity@436e53c removing INTENT_PENDING_WAIT_LOCK
Read params uri: xxxx://open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D&link_click_id=1281532594945239582 bypassCurrentActivityIntentState: false intent state: READY
extractExternalUriAndIntentExtras xxxx://open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D&link_click_id=1281532594945239582 com.xxxx.ui.MainActivity@436e53c
isIntentParamsAlreadyConsumed false
extractBranchLinkFromIntentExtra com.xxxx.ui.MainActivity@436e53c
isIntentParamsAlreadyConsumed false
processNextQueueItem onIntentReady
Queue is: 
nitializing session on user's behalf (onActivityResumed called but SESSION_STATE = UNINITIALISED)
Beginning session initialization
Session uri is null
Callback is null
Is auto init true
Will ignore intent null
Is reinitializing false
isInstantDeepLinkPossible false
Creating io.branch.referral.ServerRequestRegisterOpen@f4c1c98 from init on thread main
initializeSession io.branch.referral.ServerRequestRegisterOpen@f4c1c98 delay 0
Intent: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=xxxx://open/... flg=0x14400000 pkg=cc.xxxx.wallet cmp=cc.xxxx.wallet/com.xxxx.ui.MainActivity (has extras) } forceBranchSession: false initState: UNINITIALISED
registerAppInit io.branch.referral.ServerRequestRegisterOpen@f4c1c98
Ordering init calls
Queue is: 
Moving io.branch.referral.ServerRequestRegisterOpen@f4c1c98  to front of the queue or behind network-in-progress request
Finished ordering init calls
Queue is: io.branch.referral.ServerRequestRegisterOpen@f4c1c98 with locks []
initTasks io.branch.referral.ServerRequestRegisterOpen@f4c1c98 ignoreWaitLocks false
Could not find com.google.android.gms.ads.identifier.AdvertisingIdClient. If expected, import the dependency into your app.
processNextQueueItem onAdsParamsFetchFinished
Queue is: io.branch.referral.ServerRequestRegisterOpen@f4c1c98 with locks []
processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@f4c1c98
executeTimedBranchPostTask io.branch.referral.ServerRequestRegisterOpen@f4c1c98
callback to be returned null
onPreExecute io.branch.referral.ServerRequestRegisterOpen@f4c1c98
Found URL Query Parameter - Key: _branch_referrer, Value: H4sIAAAAAAAAA61STW/bMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7/JS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T+cbBhJpjIDyi1/YZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L//rAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w+y79pajsNYr4d5U+t5O9WzWa/H8SBvx81tlTFbUE+/VUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy++IAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5//kL/+jj6f7e5WpwC8HvkJKXAIAAA==
Found URL Query Parameter - Key: link_click_id, Value: 1281532594945239582
Current referringURLQueryParameters: {}
Play Store advertising service not found. If not expected, import com.google.android.gms.ads.identifier.AdvertisingIdClient into your gradle dependencies
processNextQueueItem registerAppInit
Queue is: io.branch.referral.ServerRequestRegisterOpen@f4c1c98 with locks []
Beginning rest post for io.branch.referral.ServerRequestRegisterOpen@f4c1c98

posting to https://api2.branch.io/v1/open
Post value = {"randomized_device_token":"1304756764390082006","randomized_bundle_token":"1305092527564680791","hardware_id":"f85ab6ff772d8170","is_hardware_id_real":true,"anon_id":"44f5c6bb-574f-49bc-b767-feb123fef9d3","brand":"motorola","model":"moto g73 5G","screen_dpi":400,"screen_height":2163,"screen_width":1080,"wifi":true,"ui_mode":"UI_MODE_TYPE_NORMAL","os":"Android","os_version":33,"country":"IN","language":"en","local_ip":"192.168.29.102","cpu_type":"aarch64","build":"T1TNS33.14-90-9-3-1-2","locale":"en_IN","connection_type":"wifi","os_version_android":"13","debug":false,"partner_data":{},"app_version":"2.24.70","initial_referrer":"https:\/\/publisher.prod.xxxx.cc\/","update":1,"latest_install_time":1712396528270,"latest_update_time":1712396528270,"first_install_time":1712396528270,"previous_update_time":1712396528270,"environment":"FULL_APP","external_intent_uri":"xxxx:\/\/open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D&link_click_id=1281532594945239582","external_intent_extra":"{\"branch_intent\":true}","metadata":{},"link_identifier":"1281532594945239582","app_store":"PlayStore","lat_val":0,"instrumentation":{"v1\/open-brtt":"405"},"sdk":"android5.11.0","branch_key":""}

Branch Networking Success
                                                                                                    URL: https://api2.branch.io/v1/open
                                                                                                    Response Code: 200
                                                                                                    Response Message: OK
                                                                                                    Retry number: 0
                                                                                                    requestId: 5c9899b7-fead-43f0-a746-c6ae3528f4c7-2024040610
                                                                                                    Object: io.branch.referral.network.BranchRemoteInterfaceUrlConnection@2ad3d98
Server returned: [5c9899b7-fead-43f0-a746-c6ae3528f4c7-2024040610] Status: [200]; Data: {"data":"{\"$og_title\":\"- A Platform\",\"expires\":\"1800\",\"$twitter_site\":\"xxxx.cc\",\"description\":\"The Wizard of Oz was released in 1939. The film is an American musical fantasy movie that has since become ingrained in Western culture.\",\"title\":\"Wizard of Oz Sequel?\",\"~feature\":\"marketing\",\"reference\":\"51253210-3757-45f8-af9d-fc4477b36786\",\"$desktop_url\":\"https://merchant.portal.xxxx.cc/pay?noApp=true\",\"~marketing\":true,\"~id\":1123477892415724549,\"+is_first_session\":false,\"$android_url\":\"https://merchant.portal.xxxx.cc/pay?noApp=true\",\"currency\":\"USD\",\"$ios_url\":\"https://merchant.portal.xxxx.cc/pay?noApp=true\",\"thumbnail\":\"https://publisher.prod.xxxx.cc/media/original_images/oz_2.jpeg\",\"amount\":\"0.3500\",\"$marketing_title\":\"Check App Availability\",\"~creation_source\":1,\"+click_timestamp\":1712398163,\"$twitter_card\":\"summary\",\"referralFee\":\"10.0000\",\"url\":\"https://publisher.prod.xxxx.cc/content/wizard-oz-sequel/\",\"$og_type\":\"website\",\"+match_guaranteed\":true,\"merchantAccount\":\"0.0.323372\",\"+clicked_branch_link\":true,\"payByCC\":\"true\",\"$one_time_use\":false,\"~referring_link\":\"https://paymentslink.xxxx.cc/checkApp?thumbnail=https%3A%2F%2Fpublisher.prod.xxxx.cc%2Fmedia%2Foriginal_images%2Foz_2.jpeg\u0026merchantAccount=0.0.323372\u0026amount=0.3500\u0026url=https%3A%2F%2Fpublisher.prod.xxxx.cc%2Fcontent%2Fwizard-oz-sequel%2F\u0026currency=USD\u0026reference=51253210-3757-45f8-af9d-fc4477b36786\u0026title=Wizard+of+Oz+Sequel%3F\u0026expires=1800\u0026description=The+Wizard+of+Oz+was+released+in+1939.+The+film+is+an+American+musical+fantasy+movie+that+has+since+become+ingrained+in+Western+culture.\u0026referralFee=10.0000\u0026confirmURL=https%3A%2F%2Fpublisher.prod.xxxx.cc%2Fcontent%2Fwizard-oz-sequel%2F\u0026payByCC=true\",\"confirmURL\":\"https://publisher.prod.xxxx.cc/content/wizard-oz-sequel/\"}","link":"https://paymentslink.xxxx.cc/a/?%24randomized_bundle_token=1305092527564680791","randomized_bundle_token":"1305092527564680791","randomized_device_token":"1304756764390082006","session_id":"1305099366062934877","session_link_click_id":"1305099366025249371"}
onPostExecuteInner io.branch.referral.ServerRequestQueue$BranchPostTask@3b1996a io.branch.referral.ServerResponse@158ce5b
onRequestSuccess io.branch.referral.ServerResponse@158ce5b
Does not have Clicked_Branch_Link or Clicked_Branch_Link is false, returning
postInitClear io.branch.referral.PrefHelper@7f45457 can clear init data true
processNextQueueItem unlockSDKInitWaitLock
Queue is: io.branch.referral.ServerRequestRegisterOpen@f4c1c98 with locks []
onRequestSucceeded io.branch.referral.ServerRequestRegisterOpen@f4c1c98 io.branch.referral.ServerResponse@158ce5b on callback null
Deferring userAgent string call for sync retrieval
onInitSessionCompleted on thread main
processNextQueueItem onPostExecuteInner
Queue is: 

InitSessionBuilder setting BranchReferralInitListener withCallback with com.xxxx.ui.MainActivity$$ExternalSyntheticLambda37@909ea90
InitSessionBuilder setting withData with xxxx://open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D
Beginning session initialization
Session uri is xxxx://open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D
Callback is com.xxxx.ui.MainActivity$$ExternalSyntheticLambda37@909ea90
s auto init false
Will ignore intent null
Is reinitializing false
Read params uri: xxxx://open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D bypassCurrentActivityIntentState: false intent state: READY
extractExternalUriAndIntentExtras xxxx://open?_branch_referrer=H4sIAAAAAAAAA61STW%2FbMAz9NfVFsGNbcZ0MEIqsQ04DBqwreiwUmY7Z6muUtC759WOWocBuO0wQQOqJ74l80JJzTB9Wq6hPDnxOFv1rM1GIsTFmZRYwr7sY7%2FJS3MFrtGq5EG7k7qbf847lYDEtQE2kML0T%2BcbBhJpjIDyi1%2FYZnT5CuiDn5755iXCsHJBZtM87Y0LxWbVN28heyrGvtPuDyKFtq0L%2F%2FrAJPvMknL3hWdNUh3Od4HsBy1BlChF4c1KPD58qghkuJ1BD1w%2By79pajsNYr4d5U%2Bt5O9WzWa%2FH8SBvx81tlTFbUE%2B%2FVUWYxZezeLgKy30FPyMSJNVtuN8JkiGMGYNX3xYQf3HedBIEFnSCSaAX3VZuG3Epm9E6gUloL3bsDRpOXEkcrZjZJ51OwoUfCCIvOouFhRJy%2B%2BIAJjhgsSNp9FfZJ0gZyAtTbC4EzXVa0nYPoDq2mlfFZs1I7vHr5%2F%2FkL%2F%2Bjj6f7e5WpwC8HvkJKXAIAAA%3D%3D com.xxxx.ui.MainActivity@436e53c
isIntentParamsAlreadyConsumed true
extractBranchLinkFromIntentExtra com.xxxx.ui.MainActivity@436e53c
isIntentParamsAlreadyConsumed true
isInstantDeepLinkPossible false
Creating io.branch.referral.ServerRequestRegisterOpen@d02a2fc from init on thread main
initializeSession io.branch.referral.ServerRequestRegisterOpen@d02a2fc delay 0
Intent: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=xxxx://open/... flg=0x14400000 pkg=cc.xxxx.wallet cmp=cc.xxxx.wallet/com.xxxx.ui.MainActivity (has extras) } forceBranchSession: true initState: INITIALISED
registerAppInit io.branch.referral.ServerRequestRegisterOpen@d02a2fc
Ordering init calls
Queue is: 
Moving io.branch.referral.ServerRequestRegisterOpen@d02a2fc  to front of the queue or behind network-in-progress request
Finished ordering init calls
Queue is: io.branch.referral.ServerRequestRegisterOpen@d02a2fc with locks []
initTasks io.branch.referral.ServerRequestRegisterOpen@d02a2fc ignoreWaitLocks false
Could not find com.google.android.gms.ads.identifier.AdvertisingIdClient. If expected, import the dependency into your app.
processNextQueueItem onAdsParamsFetchFinished
Queue is: io.branch.referral.ServerRequestRegisterOpen@d02a2fc with locks []
processNextQueueItem, req io.branch.referral.ServerRequestRegisterOpen@d02a2fc
executeTimedBranchPostTask io.branch.referral.ServerRequestRegisterOpen@d02a2fc
callback to be returned com.xxxx.ui.MainActivity$$ExternalSyntheticLambda37@909ea90
onPreExecute io.branch.referral.ServerRequestRegisterOpen@d02a2fc
Current referringURLQueryParameters: {}
Play Store advertising service not found. If not expected, import com.google.android.gms.ads.identifier.AdvertisingIdClient into your gradle dependencies
Beginning rest post for io.branch.referral.ServerRequestRegisterOpen@d02a2fc
processNextQueueItem registerAppInit
Queue is: io.branch.referral.ServerRequestRegisterOpen@d02a2fc with locks []
posting to https://api2.branch.io/v1/open
Post value = {"randomized_device_token":"1304756764390082006","randomized_bundle_token":"1305092527564680791","hardware_id":"f85ab6ff772d8170","is_hardware_id_real":true,"anon_id":"44f5c6bb-574f-49bc-b767-feb123fef9d3","brand":"motorola","model":"moto g73 5G","screen_dpi":400,"screen_height":2163,"screen_width":1080,"wifi":true,"ui_mode":"UI_MODE_TYPE_NORMAL","os":"Android","os_version":33,"country":"IN","language":"en","local_ip":"192.168.29.102","cpu_type":"aarch64","build":"T1TNS33.14-90-9-3-1-2","locale":"en_IN","connection_type":"wifi","os_version_android":"13","debug":false,"partner_data":{},"app_version":"2.24.70","initial_referrer":"https:\/\/publisher.prod.xxxx.cc\/","update":1,"latest_install_time":1712396528270,"latest_update_time":1712396528270,"first_install_time":1712396528270,"previous_update_time":1712396528270,"environment":"FULL_APP","metadata":{},"app_store":"PlayStore","lat_val":0,"instrumentation":{"v1\/open-brtt":"465"},"sdk":"android5.11.0","branch_key":""}
lastResponseMessage OK
Branch Networking Success
                                                                                                    URL: https://api2.branch.io/v1/open
                                                                                                    Response Code: 200
                                                                                                    Response Message: OK
                                                                                                    Retry number: 0
                                                                                                    requestId: e402f496-9a97-4c31-acc4-b80065e814ba-2024040610
                                                                                                    Object: io.branch.referral.network.BranchRemoteInterfaceUrlConnection@2ad3d98
Server returned: [e402f496-9a97-4c31-acc4-b80065e814ba-2024040610] Status: [200]; Data: {"data":"{\"+clicked_branch_link\":false,\"+is_first_session\":false}","link":"https://paymentslink.xxxx.cc/a/?%24randomized_bundle_token=1305092527564680791","randomized_bundle_token":"1305092527564680791","randomized_device_token":"1304756764390082006","session_id":"1305099386212507843"}
onPostExecuteInner io.branch.referral.ServerRequestQueue$BranchPostTask@e21b83d io.branch.referral.ServerResponse@6ac3832
onRequestSuccess io.branch.referral.ServerResponse@6ac3832
No activity reference to launch deep linked activity
postInitClear io.branch.referral.PrefHelper@7f45457 can clear init data true
processNextQueueItem unlockSDKInitWaitLock
Queue is: io.branch.referral.ServerRequestRegisterOpen@d02a2fc with locks []
onRequestSucceeded io.branch.referral.ServerRequestRegisterOpen@d02a2fc io.branch.referral.ServerResponse@6ac3832 on callback com.xxxxf.ui.MainActivity$$ExternalSyntheticLambda37@909ea90
referringParams {"+clicked_branch_link":false,"+is_first_session":false}

Expected behavior

It should provide complete data in the branch callback listener.

SDK Version

5.11.0

Make and Model

Motorola Moto G73 5g and Pixel 7

OS

Android 13 and Android 14

Additional Information/Context

override fun onNewIntent(intent: Intent) {
        super.onNewIntent(intent)
        AppLog.e("onNewIntent", "intent -> $intent")
        this.intent = intent
        handleIntent()
    }

    private val branchListener = Branch.BranchReferralInitListener { referringParams, error ->
        if (error == null) {
            referringParams?.let { jsonObject ->
                AppLog.e("BranchListener Invoke", "referringParams " + referringParams)
                mainViewModel.handleJsonData(jsonObject)
            }
        } else {
            AppLog.e("BRANCH SDK", error.message)
        }
        clearIntent()
    }

    private fun handleIntent() {
        Handler(Looper.getMainLooper()).postDelayed({
            if (!mainViewModel.handleIntent(intent)) {
                intent.putExtra("branch_force_new_session", true)
                Branch.sessionBuilder(this).withCallback(branchListener).withData(this.intent.data).init()
            } else {
                clearIntent()
            }
        }, 1000)
    }

    private fun clearIntent() {
        val intent = this.intent
        intent.data = null
        intent.replaceExtras(Bundle())
        this.intent = intent
    }
aadityapaliwal commented 3 months ago

I am not sure but I just change the branch session builder as per the new docs and it seems started working. I will test it more. Closing it for now.