RodrigoSMarques / flutter_branch_sdk

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

Trouble initializing Branch. Tracking is disabled. Requested operation cannot be completed when tracking is disabled #339

Closed qirong-zhang-ext closed 4 months ago

qirong-zhang-ext commented 5 months ago

Describe the bug Set disable tracking with true, then cold lunch the Android App, will get log like:

D/FlutterBranchSDK(27451): BranchReferralInitListener - error: Trouble initializing Branch.   Tracking is disabled. Requested operation cannot be completed when tracking is disabled

To Reproduce Steps to reproduce the behavior:

  1. call this on main function:

    await FlutterBranchSdk.init();
    FlutterBranchSdk.disableTracking(true);
  2. call this when home page init:

    void addBranchDeepLinkCallback() {
    FlutterBranchSdk.listSession().listen(
      handleBranchData,
      onError: (error) {
        _logService.sendLog(
          LEVEL.WARN,
          'FlutterBranchSdk InitSession error: $error',
        );
      },
    );
    }
  3. Just start the app

Expected behavior Should init sdk successfully without error log.

Screenshots If applicable, add screenshots to help explain your problem.

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

RodrigoSMarques commented 5 months ago

I don't understand what you want.

The native Branch SDK on Android returns an error when the SDK is not successfully initialized.

The plugin is capturing this error and sending it to Flutter.

In Flutter, you capture the error and handle it according to your application's business logic.

The plugin cannot ignore the error and continue processing.

qirong-zhang-ext commented 5 months ago

Hi @RodrigoSMarques,

Thanks for your reply!

Just want to confirm if this error will block any functionality of Branch. But seems like this error throwed by native SDK instead of plugin.

Want to know if this error is an expected behavior when disabled the tracking?

Thanks again.

RodrigoSMarques commented 4 months ago

Hi @RodrigoSMarques,

Thanks for your reply!

Just want to confirm if this error will block any functionality of Branch. But seems like this error throwed by native SDK instead of plugin.

Want to know if this error is an expected behavior when disabled the tracking?

Thanks again.

Hi @qirong-zhang-ext

Yes. This is expected behavior.

Check here:

https://help.branch.io/developers-hub/docs/honoring-opt-out-of-processing-requests#overview

https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/issues/455

https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking-attribution/issues/455

qirong-zhang-ext commented 4 months ago

Hi @RodrigoSMarques,

Thanks a lot for your information!

Then I will close this issue.đŸ«¡