GoodDollar / GoodDAPP

GoodDollar.org Wallet is the simplest access point to Claim your daily G$. It Is based on web3 and React native web.
good-dapp.vercel.app
MIT License
100 stars 53 forks source link

Bug: Android 13 does not allow clipboard permissions #4142

Closed L03TJ3 closed 8 months ago

L03TJ3 commented 9 months ago

Description

Bug: Cannot use paste button as there is no way to give clipboard permissions Expected: user should be able to paste last item from clipboard by clicking a button

L03TJ3 commented 9 months ago

@johnsmith-gooddollar @sirpy I don't know if I have been looking at it wrong? have you noticed it before?

Any suggestions on how to handle?

L03TJ3 commented 9 months ago

@johnsmith-gooddollar @sirpy After now testing.. Since there is no way for the user to give permissions specifically to an app anyway... We don't seem to need the usePermissions hook (!for android!) as removing it and just doing paste works fine.

Can I implement to disable or skipped the permissions check on android?

To clarify, I am talking about here: https://github.com/GoodDollar/GoodDAPP/blob/8f5dab2900cbec7efd4c725808c3aeaef2cde018/src/components/dashboard/Amount.js#L86-L97

But also could (or should then) be applied to wallet-connect input field here: https://github.com/GoodDollar/GoodDAPP/blob/8f5dab2900cbec7efd4c725808c3aeaef2cde018/src/components/walletconnect/WalletConnectScan.js#L113-L123

sirpy commented 9 months ago

@L03TJ3 what does the documentation say? You need to verify the following:

  1. android usePermission for clipboard is different than web. on web you still need permissions as far as I know
  2. what about older androids? it needs to work on old androids also
johnsmith-gooddollar commented 9 months ago

@sirpy there was no permissions for clipboard at Android and never existed, it always enabled by default. the usePermission hooks uses separate .web and .native implementation. In native one if we receive clipboard we immediately return true without checking anything. So if we have an error now that means something is broken and I've suggested @L03TJ3 to check hook and classes it uses

sirpy commented 9 months ago

@L03TJ3 This ticket is not defined good enough, since no permissions are required why are you claiming it is a permissions problem? I see the clipboard packages we use for native is an old one (in Clipboard.native.js), so lets try and switch to the package you linked in the ticket.

L03TJ3 commented 9 months ago

@sirpy That's what I first thought, the issue got cleared up during daily on friday ( I just have not updated the task yet) but it is as @johnsmith-gooddollar describes. even when android does not use clipboard permissions, we still use the hook. For android this permission should automatically skip any checks and return permission as true.

Clipboard functionallity works! It just a bug in the hook used which wrongly returns that it doesn't have permissions

For reference: https://github.com/GoodDollar/GoodDAPP/blob/8f5dab2900cbec7efd4c725808c3aeaef2cde018/src/components/permissions/api/PermissionsAPI.native.js#L16

L03TJ3 commented 9 months ago

fixed here: https://github.com/GoodDollar/GoodDAPP/commit/603d5d36815300fcb54f94aeaf10e18fdd48a755

vldkhh commented 9 months ago

verified on dev

vldkhh commented 8 months ago

@L03TJ3 could you check on your Android 13, please? Its working on my Android 10

L03TJ3 commented 8 months ago

@vldkhh yes works here so closing