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

Flutter Branch SDK doesn't auto reinitialise when we use the GoogleSignIn method for Signing IN only in Android #416

Open
vamsi-branch opened this issue Feb 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@vamsi-branch
Copy link

Keep the template and provide all requested information:

Describe the bug
Flutter Branch SDK doesn't auto reinitialise when we use the GoogleSignIn method for Signing IN.
As Google SignIn creates new activity, when we are finished with it, the MainActivity of the App resumes, but the branch sdk doesn't resume in this particular flow.

To Reproduce
Steps to reproduce the behavior:

  1. Go to drive link and download the setup
  2. Would be required to clean cache and re-run flutter
  3. Now After the app is installed, click on the LoginButton which will open the login flow and after it ends, we will be redirected to mainactivity
  4. When we try to track any content we find that the branch sdk didn't re-init.

Expected behavior
The expected behaviour is that after the siginin screen is completed, the main activity is resumed with the branch sdk

Logs

2025-02-07 11:52:38.392 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityPaused: com.mosl.research360app.MainActivity
2025-02-07 11:52:38.454 31559-31559 BranchSDK com.mosl.research360app V onActivityCreated, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:38.454 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityCreated: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:38.515 31559-31559 BranchSDK com.mosl.research360app V onActivityStarted, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:38.515 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityStarted: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:38.521 31559-31559 BranchSDK com.mosl.research360app V onActivityResumed, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:38.522 31559-31559 BranchSDK com.mosl.research360app V onIntentReady com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec removing INTENT_PENDING_WAIT_LOCK
2025-02-07 11:52:38.522 31559-31559 BranchSDK com.mosl.research360app V processNextQueueItem onIntentReady
2025-02-07 11:52:38.522 31559-31559 BranchSDK com.mosl.research360app V Queue is:
2025-02-07 11:52:38.522 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityResumed: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:38.548 31559-31559 BranchSDK com.mosl.research360app V onActivityPaused, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:38.548 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityPaused: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:44.834 31559-31559 BranchSDK com.mosl.research360app V onActivityResumed, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:44.834 31559-31559 BranchSDK com.mosl.research360app V onIntentReady com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec removing INTENT_PENDING_WAIT_LOCK
2025-02-07 11:52:44.834 31559-31559 BranchSDK com.mosl.research360app V processNextQueueItem onIntentReady
2025-02-07 11:52:44.834 31559-31559 BranchSDK com.mosl.research360app V Queue is:
2025-02-07 11:52:44.834 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityResumed: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:44.850 31559-31559 BranchSDK com.mosl.research360app V onActivityPaused, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:44.850 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityPaused: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:44.888 31559-31559 BranchSDK com.mosl.research360app V onActivityResumed, activity = com.mosl.research360app.MainActivity@62c0df
2025-02-07 11:52:44.888 31559-31559 BranchSDK com.mosl.research360app V onIntentReady com.mosl.research360app.MainActivity@62c0df removing INTENT_PENDING_WAIT_LOCK
2025-02-07 11:52:44.888 31559-31559 BranchSDK com.mosl.research360app V processNextQueueItem onIntentReady
2025-02-07 11:52:44.888 31559-31559 BranchSDK com.mosl.research360app V Queue is:
2025-02-07 11:52:44.888 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityResumed: com.mosl.research360app.MainActivity
2025-02-07 11:52:44.933 31559-31559 BranchSDK com.mosl.research360app V onActivityStopped, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:44.933 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityStopped: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:44.945 31559-31559 BranchSDK com.mosl.research360app V onActivityDestroyed, activity = com.google.android.gms.auth.api.signin.internal.SignInHubActivity@8b3bfec
2025-02-07 11:52:44.946 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered onActivityDestroyed: com.google.android.gms.auth.api.signin.internal.SignInHubActivity
2025-02-07 11:52:48.531 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered trackContent
2025-02-07 11:52:48.533 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered trackContent
2025-02-07 11:52:48.534 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered trackContentWithoutBuo
2025-02-07 11:52:48.535 31559-31559 FlutterBranchSDK com.mosl.research360app D triggered trackContentWithoutBuo
2025-02-07 11:52:48.538 31559-31559 BranchSDK com.mosl.research360app V setPostUserAgent main
2025-02-07 11:52:48.538 31559-31559 BranchSDK com.mosl.research360app V userAgent was cached: Mozilla/5.0 (Linux; Android 12; SM-M215F Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/132.0.6834.163 Mobile Safari/537.36
2025-02-07 11:52:48.538 31559-31559 BranchSDK com.mosl.research360app V processNextQueueItem setPostUserAgent
2025-02-07 11:52:48.538 31559-31559 BranchSDK com.mosl.research360app V Queue is:
2025-02-07 11:52:48.546 31559-31559 BranchSDK com.mosl.research360app V Preparing V2 event, user agent is Mozilla/5.0 (Linux; Android 12; SM-M215F Build/SP1A.210812.016; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/132.0.6834.163 Mobile Safari/537.36
2025-02-07 11:52:48.546 31559-31559 BranchSDK com.mosl.research360app D handleNewRequest io.branch.referral.util.BranchEvent$1@cf709d
2025-02-07 11:52:48.546 31559-31559 BranchSDK com.mosl.research360app D handleNewRequest io.branch.referral.util.BranchEvent$1@cf709d needs a session
2025-02-07 11:52:48.548 31559-31559 BranchSDK com.mosl.research360app V processNextQueueItem handleNewRequest
2025-02-07 11:52:48.548 31559-31559 BranchSDK com.mosl.research360app V Queue is: io.branch.referral.util.BranchEvent$1@cf709d with locks [SDK_INIT_WAIT_LOCK]

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

  • FlutterSDK: version: 3.27.1

  • flutter_branch_sdk version: 8.2.0

  • OS: All Android version

  • Additional context
    This is the life cycle flow that is actually happening
    onActivityPaused → MainActivity
    onActivityCreated → SignInHubActivity
    onActivityStarted → SignInHubActivity
    onActivityResumed → SignInHubActivity
    onActivityPaused → SignInHubActivity
    onActivityResumed → SignInHubActivity
    onActivityPaused → SignInHubActivity
    onActivityResumed → MainActivity

But on the final onActivityResumed when MainActivity is resumed the branch sdk is not being called which should be

The drive link shared contains the below

  1. Video recording
  2. Sample Project
  3. Complete logs
@vamsi-branch vamsi-branch added the bug Something isn't working label Feb 11, 2025
@RodrigoSMarques
Copy link
Owner

I will evaluate.

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

No branches or pull requests

2 participants