I am going through the motions of creating my first dApp using Moralis, however I have hit a brick wall with an issue when using it on an iphone or ipad, which i donât get when using it on my PC. I have tried it in both Safari and Chrome. The sign in to my wallet works fine but on actioning the function i just get Non ethereum enabled browser
I have googled lots of posts where others seem to see the same, but the proposed fixes donât work for me.
I am coding the dApp in Visual Studio Code and have the Live Server and walletconnect extensions installed. I am using WIX to build a webpage for the dDapp where I copy in the html.
I have these pertinent sections in my html file:-
let provider = 'metamask';
let web3;function Login(){
try {
console.log("login clicked");
let provider = 'walletconnect';
var user = Moralis.Web3.authenticate({ provider: 'walletconnect',
mobileLinks: [
"metamask",
"trust",
]});
console.log("Logged in via walletconnect:", user);
} catch (error) {
console.log('Failed to login', error);
}
}
async function rungetPrice() {
try {
if(provider == âwalletconnectâ) {
web3 = await Moralis.enableWeb3({ provider: âwalletconnectâ });
}
else {
web3 = await Moralis.enableWeb3();
}
const options = {
address: inpCN.value,
chain: âbscâ,
exchange: âPancakeSwapv2â
};
const price = await Moralis.Web3API.token.getTokenPrice(options);
console.log('Price: ', price)
} catch (error) {
console.log(âFailedâ, error);
}
}
I have also included
within script tags
Have I something missing somewhere, another VSC extension perhaps or is there an issue with my code that causes this problem top manifest itself?
Thanks in anticipation.