Skip to content

enable background usage on android with v2 embedding#813

Open
daZwala wants to merge 6 commits intopauldemarco:masterfrom
daZwala:master
Open

enable background usage on android with v2 embedding#813
daZwala wants to merge 6 commits intopauldemarco:masterfrom
daZwala:master

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.

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.

3 participants