Skip to content

Conversation

@ViscousPot
Copy link
Contributor

@ViscousPot ViscousPot commented Jan 31, 2025

Description

Currently, when sending an intent, any native errors occur silently without any notification to the flutter side of code.
This adds error forwarding back to flutter through the MethodCaller.
This is achieved by wrapping the whole caller in a try/catch

This can be tested by trying to send an intent to an Activity that doesn't exist.

  • Previous behaviour, it would show a native error in the log but this is not catchable in flutter code
  • New behaviour forwards the error and allows it to be caught

Related Issues

No related issues exist for this

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@miquelbeltran miquelbeltran changed the title feat(android_intent_plus): adds error catching and forwarding fix(android_intent_plus): adds error catching and forwarding Feb 1, 2025
@miquelbeltran miquelbeltran merged commit 37f533c into fluttercommunity:main Feb 1, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants