When selling an NFT through a mobile app, the user faces two mandatory transactions: approve and listing. Each requires confirmation and gas expenditure. The choice between approve and setApprovalForAll impacts both cost and user trust. Let's break down the implementation.
Choosing between approve and setApprovalForAll
setApprovalForAll(marketplaceAddress, true) grants permission for all tokens in a collection. The user does this once, then can list any NFT from that collection without repeated approve. approve(marketplaceAddress, tokenId) grants permission for a single token. Safer, but each listing requires a separate transaction.
| Criterion | setApprovalForAll | approve |
|---|---|---|
| Transactions for first listing | 2 (approve + list) | 2 (approve + list) |
| Transactions for subsequent listing | 1 (list) | 2 (approve + list) |
| Gas cost for 5 listings | 6 transactions | 10 transactions |
| Security | Lower (risk for entire collection) | Higher (only one token) |
| UX | Better — fewer confirmations | Worse — approve each time |
Recommended UX: on the first listing from a collection, offer setApprovalForAll with an explanation. For rare tokens (1/1), use approve. The ERC-721 standard on Wikipedia defines the interfaces.
// iOS — check approval before listing func checkApproval(nftContract: EthereumAddress, owner: EthereumAddress) async -> Bool { let erc721 = ERC721(web3: web3, provider: web3.provider, address: nftContract) return (try? await erc721.getApproved(tokenId: tokenId) == marketplaceAddress) ?? (try? await erc721.isApprovedForAll(owner: owner, operator: marketplaceAddress)) ?? false } Optimizing Gas Costs
On Ethereum, each transaction costs approximately $10–$50 at average gas prices; on Polygon, fees are under $0.01. Using setApprovalForAll reduces gas costs by up to 40% for frequent sellers. For 5 listings, approve requires 10 transactions, while setApprovalForAll needs only 6, saving roughly $40 on Ethereum.
| Operation | Ethereum (gwei 50) | Polygon (gwei 100) |
|---|---|---|
| approve | ~$15 | ~$0.001 |
| list | ~$15 | ~$0.001 |
| updateListing | ~$15 | ~$0.001 |
| cancelListing | ~$15 | ~$0.001 |
Listing Form and Fee Breakdown
Minimum fields: price (in ETH or ERC-20 token), optional listing deadline. Show the net amount the seller receives: netAmount = price * (1 - platformFee - royalty). For example, if price is 1 ETH, platform fee 2.5%, royalty 5%, net is 0.925 ETH. Use ERC-2981 royalty standard.
// Android — calculate net amount for NFT listing in Kotlin val grossPrice: BigDecimal, val platformFeePercent: BigDecimal, val royaltyPercent: BigDecimal, val platformFeeAmount get() = grossPrice * platformFeePercent / BigDecimal(100) val royaltyAmount get() = grossPrice * royaltyPercent / BigDecimal(100) val sellerReceives get() = grossPrice - platformFeeAmount - royaltyAmount Transparency in fees increases trust and boosts transaction completion by 20%. A Swift NFT marketplace app should display royalty breakdown explicitly; a Kotlin NFT listing app must calculate net amount before user confirms.
Listing Flow with Checkpoints
- Check approval → if not, send
approve/setApprovalForAll. Show a modal explaining the gas cost (e.g., ~$15 on Ethereum). - Wait for approve confirmation — progress indicator with block animation.
- Send
listItem(nftAddress, tokenId, price, deadline)— wait for confirmation again. - After confirmation — NFT appears in the catalog.
Each step with a progress indicator. If the user closes the app after step 1, on next open check approval and offer to continue from step 3. This fault tolerance is mandatory for production apps.
Common errors: user didn't wait for approve confirmation and sent list (transaction fails), insufficient ETH balance for gas, approve to wrong marketplace address (always verify address in UI).
Changing Price and Removing from Sale
updateListing(nftAddress, tokenId, newPrice) — one transaction without re-approval. cancelListing(nftAddress, tokenId) — remove listing. After confirmation, NFT disappears from catalog. Show the "Remove from sale" button only when listing is active (check on-chain or indexer).
Presenting net seller amount after fees is crucial. A user seeing 1 ETH but receiving 0.85 ETH without explanation will be disappointed. Pre-displaying fees leads to higher satisfaction and fewer support tickets.
What's Included in Implementation
We have over 5 years of experience in mobile blockchain integrations. We deliver:
- Development of NFT listing UI on iOS with fee breakdown.
- Integration of ERC721/ERC1155 and ERC2981 smart contracts.
- Handling push notifications about transaction status (via APNs/FCM).
- Testing on real devices and simulators.
- Preparation of metadata for App Store and Google Play (including description for App Store Review Guidelines Section 4.2).
- Documentation and code comments.
- Training for your team on maintaining the marketplace.
- 30 days of post-launch support.
Timeline: from 3 to 5 business days. We'll evaluate your project in 1 day. Get a consultation for your project — we guarantee transparency and deadline adherence.







