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

fix(firebase_messaging): Support Android v2 embedding #3572

Closed

Conversation

jorgeroncero
Copy link
Contributor

Description

The firebase_messaging plugin is not ready for Android v2 embedding. It is currently using v1 embedding and requires the applications to declare a PluginRegistrantCallback to work. This current behaviour results in a crash if you don't declare the callback and your application is using v2 embedding.

To make it work with v2 embedding, and following the Upgrading pre 1.12 Android projects guide and the Android Alarm Manager plugin implementation, this PR has the following changes:

  • Removed the references to FlutterMain.ensureInitializationComplete which is called twice in the java code.
  • Changed FlutterNativeView related code to FlutterEngine related code.
  • Changed pluginRegistrantCallback mandatory requirement to optional (since it will only be used in v1 embedding)

Related Issues

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • If the pull request affects only one plugin, the PR title starts with the name of the plugin in brackets (e.g. [cloud_firestore])
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy.
  • I updated CHANGELOG.md to add a description of the change.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

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 a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

* Removed the references to FlutterMain.ensureInitializationComplete
* Changed FlutterNativeView related code to FlutterEngine related code
* Change pluginRegistrantCallback mandatory requirement to optional (since it will only be used in v1 embedding). If used with v2, app will crash
@jorgeroncero jorgeroncero changed the title [firebase_messaging] Support Android v2 embedding fix(firebase_messaging): Support Android v2 embedding Oct 6, 2020
@diegogarciar
Copy link
Contributor

Hello,
Could you speed up this PR? It has conflicts on the easiest files and this bug is making apps unusable for some.

Thanks in advance!

@Ehesp
Copy link
Member

Ehesp commented Oct 21, 2020

Should have a dev release very soon. Thinking within the next 24hrs.

@Salakar Salakar closed this in #4012 Nov 3, 2020
@firebase firebase locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants