mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 463 forks source link

ClipboardManager workaround for Android 10 #171

Closed erdemyerebasmaz closed 4 years ago

erdemyerebasmaz commented 4 years ago

Android 10 introduces a new permission called "READ_CLIPBOARD_IN_BACKGROUND” that limits background clipboard access only to OEM apps. "Breez app" loses focus when the plugin opens up and Android prevents access to clipboard for the sake of privacy.

As a workaround, we pass the last item on clipboard from Breez app to the plugin. However, this has a drawback for Android 10. If the user opens the plugin and puts the app in background to copy a text, clipboard won't be updated when user opens the app again. The user needs to open the plugin from the app again to get the latest clipboard item.