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

Metamask confirm button is blue, but doesn't respond to clicks(taps) in the mobile app, but the same JS code works on the desktop - custom BSC Token. #5235

Closed
amftokenofficial opened this issue Nov 13, 2022 · 2 comments
Labels
type-bug Something isn't working

Comments

@amftokenofficial
Copy link

https://i.stack.imgur.com/vR19j.jpg

I use JS and WalletConnectProvider (website project). Connecting to Metamask by WalletConnect, then call transfer function for custom token contract. I use the same code on desktop and it works and transferring token. Exactly the same code doesn't work on mobile (for Metamask Mobile app). Checked IOS and also Android - the same issue. Please tell me what is wrong with my code:

<script src="https://cdn.jsdelivr.net/npm/@walletconnect/web3-provider@1.8.0/dist/umd/index.min.js"></script>
<script src="https://[mywebsitescriptspath]/web3.min.js"></script> // 1.8.0

<script type="text/javascript">

var contract
var accountFrom
const ABI = "... abi here....."

var provider = new WalletConnectProvider.default({
                        
infuraId: 'my infura id',
            
rpc: {
    1: "https://mainnet.infura.io/v3/[myinfuraid]",
    56: "https://bsc-dataseed.binance.org/"
    },
                
})

const contractAddress = '0xcontraddresshere'
const receiver = '0xreceiveraddresshere'

var connect = async () => {
await provider.enable()
var web3 = new Web3(provider)
                    
web3.givenProvider = web3.currentProvider
web3.eth.givenProvider = web3.currentProvider
web3.eth.accounts.givenProvider = web3.currentProvider

window.w3 = web3
        
contract = new w3.eth.Contract(ABI, contractAddress)

await w3.eth.getAccounts().then(accounts => {
    accountFrom = accounts[0]
    })
}

connect()

// function called after the button click
var sendtransaction = async () => {

let vall = 100
let calcAmount = w3.utils.toWei(vall.toString())

let transfer =  await contract.methods.transfer(receiver, calcAmount);

await transfer.send({from: accountFrom})
.on('transactionHash', function(hash){
   console.log(hash)
})
}
</script>

I tried many different things but it doesn't work.

Tested on wifi, on 4g, on different mobile browsers, on different smartphones (android and IOS). no success.

  • iPhone 10, iPhone 13 Pro, Samsung phone
  • iOS and Android
  • App Version of MetaMask: 5.9.0 and 5.9.1

question submitted also on stackoverflow: https://stackoverflow.com/questions/74278420/metamask-confirm-button-is-blue-but-doesnt-respond-to-clickstaps-in-the-mobi

@amftokenofficial amftokenofficial added the type-bug Something isn't working label Nov 13, 2022
@ssa3512
Copy link

ssa3512 commented Nov 17, 2022

I believe this is the same as #5193

@amftokenofficial
Copy link
Author

I believe this is the same as #5193

yes, it is. thanks @ssa3512

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants