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

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag #266

Closed
sohaib37104 opened this issue Nov 29, 2023 · 5 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@sohaib37104
Copy link

Describe the bug
Clicking on link and going to app through chrome working fine but i when i am going through "App Links that open URLs directly into an app" is giving this errror.
E/MethodChannel#flutter_branch_sdk/message(14070): Failed to handle method call
E/MethodChannel#flutter_branch_sdk/message(14070): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
E/MethodChannel#flutter_branch_sdk/message(14070): Failed to handle method call
E/MethodChannel#flutter_branch_sdk/message(14070): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

To Reproduce
Steps to reproduce the behavior:

  1. Intalize flutter branc sdk in flutter project
  2. create short url and share on whatsapp and then click on the link then dialog will appear where you want to open this link either through chrome or your app when i click on my app then this error is coming if i am going to open link through chrom its working fine.

Expected behavior
Deep link need to go to specific screen in my app when i go thorught my app not chrome.

Screenshots

Screenshot 2023-11-29 at 2 55 52 PM

WhatsApp Image 2023-11-29 at 2 57 43 PM

Screenshot 2023-11-29 at 3 01 49 PM

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

  • Flutter: version: [e.g.3.13.0]

  • Package version: [e.g.flutter_branch_sdk: ^7.0.1]

  • OS: [Android 11]

  • Device: [Realme C25]

  • Additional context

  • i have configured the branch dashboard configuration i am sharing the screenshot of branch dashboard.

  • i hope you understand my situration if you need more information about issue let me know thanks.

  • waiting for your feedback.

Add any other context about the problem here.

@sohaib37104 sohaib37104 added the bug Something isn't working label Nov 29, 2023
@RodrigoSMarques
Copy link
Owner

problem under analysis here #261

@RodrigoSMarques RodrigoSMarques added the duplicate This issue or pull request already exists label Dec 6, 2023
@RodrigoSMarques RodrigoSMarques changed the title Calling startActivity() from outside of an Activity Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag Dec 7, 2023
RodrigoSMarques added a commit that referenced this issue Dec 7, 2023
* Fix issue #261 / #266 / #268: Calling startActivity() from outside of an Activity
* Fix issue #265: New release 7.0.0+ not getting a deeplink data on first launch, when app is on resume
* Fix issue #264: Android (PlayStore) : Branch SDK Params empty on background state
* Removing unused code
@RodrigoSMarques
Copy link
Owner

Hi @sohaib37104

I fixed the bug, but I need help testing the changes in different scenarios.

Can you help me with testing the new version before publishing it on pub.dev?

Update pubspec.yaml, according to the example below:

#flutter_branch_sdk:
flutter_branch_sdk:
     git:
       url: https://github.com/RodrigoSMarques/flutter_branch_sdk.git
       ref: v7.0.2-dev

I'm waiting for the test results.

Thanks.

@sohaib37104
Copy link
Author

sohaib37104 commented Dec 8, 2023

Hi @RodrigoSMarques
Thanks
okay sure let me check

@sohaib37104
Copy link
Author

Hi @RodrigoSMarques I have check now in my application its working perfectly fine Thank you very much for listening to my request i greatly appreciate your effort.thanks

@RodrigoSMarques
Copy link
Owner

RodrigoSMarques commented Dec 20, 2023

Fixed in version 7.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants