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

enable background usage on android with v2 embedding #813

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

daZwala
Copy link

@daZwala daZwala commented Apr 10, 2021

Changes to initialization code, on android because with v2 embedding onAttachedToActivity is not called when using the plugin from within an isolate (tested with isolate_handler and foreground_service).

I also noticed some complications when using the plugin in different isolates, eg. listeners on BluetoothGatt still being called after teardown.

@@ -158,25 +165,22 @@ private void setup(
if (registrar != null) {
// V1 embedding setup for activity listeners.
registrar.addRequestPermissionsResultListener(this);
} else {
// V2 embedding setup for activity listeners.
activityBinding.addRequestPermissionsResultListener(this);

Choose a reason for hiding this comment

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

I'd like to understand this code more. Why is the V2 embedding removed?

Choose a reason for hiding this comment

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

It was moved to onAttachedToActivity(ActivityPluginBinding binding).

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.

None yet

3 participants