#15 - A Complete Guide to Mint Solana NFTs through a Mobile App (Android)
Last updated
Last updated
Author:
See the example repo
Creat candy machine through Metaplex js
Creat a Pixel 4 Android virtual device
Run react-native app on Android Emulator
Connect wallet through
Upload image and metadata to Arweave
Mint Solana NFT through candy machine
The demo procedure is running on solana devnet
There are two ways to develop React Native App.
Expo Go
React Native CLI
So I suggest you to use React Native CLI method to setting up your development environment.
And remeber select Pixel 4 which is the newest verison has Play Store inside.
System Image please select "S API Level 31"
After you run up your virtual Pixel 4, remember to install Phantom or Solflare.
metaplex-candy-machine-example
https://github.com/BoxInThePARK/metaplex-candy-machine-example
mobile-nft-mint-example
https://github.com/BoxInThePARK/mobile-nft-mint-example
Set Arweave Package to Local Patch
Right now, arweave-js
hasn't completely supported react-native yet. Therefore, if you want to upload image or metadata to Arweave network through arweave-js
package. You will address some issues occured by some needed packages are unable to resolve on react-native. Because react-native doesn't have them.
To solve these problems, not only you should install other packages, you also need to do small modification on the package's sourcecode. This is the reason why we set arweave-js
as a local patch,
Here are the steps:
Install
Modify source code
.env
FilePaste this to .env
Then you can get a new candy machine address.
.env
FilePaste this to .env
Recommend to have two terminal windows here.
Run the Metro
Install App
Set Wallet to devnet
https://reactnative.dev/docs
https://github.com/solana-mobile/mobile-wallet-adapter
https://github.com/solana-mobile/mobile-wallet-adapter/tree/main/examples/example-react-native-app
https://github.com/metaplex-foundation/js-examples/tree/main/mint-ui-example
https://docs.metaplex.com/programs/token-metadata/overview
https://github.com/thuglabs/arweave-image-uploader
Since Solana Mobile SDK hasn't support iOS yet. You can't connect wallet with on iOS devices. As a result, this tutorial only works on Android right now.
We don't talk about which one is better here. The point is I have tried to run this code with Expo Go. However it still has some issues when using , but it works fine with React Native CLI.
Follow this to setup.
Follow this to create a virtual device.
Follow this to setup your Arweave wallet and claim free AR token by completing assigned . You should have a downloaded key file after the setup. We will need the keyfile in the rest of the tutorial.
Follow this to setup your Arweave wallet and claim free AR token by completing assigned task.
The procedure comes from SolMeet #3. You can take a detail look at