Skip to content

[Android] Unable to use the library in background #214

@alle-iacob

Description

@alle-iacob

Operation fails when trying to start scan in ForegroundTask due to dependency on Activity.

Proposed solution:

  • Remove activity from PermissionsHandler constructor
  • Make PermissionsHandler activity aware -> to set activity instance when available (check for null is already present in requestPermissions method)
  • Replace requestPermissions with hasPermissions inside _ensureInitialized and throw error if not granted -> let the user request permission when activity available and start scan even if App in background if permissions already granted

Note:
I already have a fix for this but I am not able to push into the repo (patch attached)

universal_ble_background_scan.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions