I'm currently developing an app using Ionic Angular (TypeScript) that will be compatible with both Android and iOS devices. I've decided to incorporate the Moralis SDK to establish a connection with the Metamask wallet.
Here's a summary of the steps I've taken so far and the obstacle I'm facing:
- Created a new Ionic project
- Installed the Moralis package using npm
- Initialized Moralis with the application ID and server URL
- Attempted to authenticate using the following code:
this.user = await Moralis.authenticate({
signingMessage: "Log in using Moralis",
})
.then(function (user) {
console.log("logged in user:", user);
console.log(user.get("ethAddress"));
})
.catch(function (error) {
console.log(error);
});
Unfortunately, I encountered an error message:
Error: Non ethereum enabled browser
I also tried running the project through Ionic serve, which successfully opened the Metamask extension upon clicking the login button and authenticated the application.
My goal is to have the Metamask wallet application open on my Android device when I click the login button for authentication.
If anyone has any solutions or recommendations, or if there are existing boilerplate projects for Ionic that I can refer to, I would greatly appreciate the assistance.