Setting Up In-App Purchase Products
Last updated
Last updated
This guide will walk you through the process of setting up in-app purchase (IAP) products for your Spot the Difference game's store.
Your game includes two main types of IAP products:
Coin Products: These are consumable items that players can purchase to obtain in-game coins.
No Ads Product: This is a non-consumable item that removes ads from the game when purchased.
In the Unity Editor, navigate to your Project window.
Go to Assets > SpotTheDifferences > Resources > ProductIDs
.
Here you'll find the product definitions for your IAPs.
You have multiple coin products available:
CoinsProduct1
CoinsProduct2
CoinsProduct3
CoinsProduct4
For each Coin Product:
Select the product in the Project window.
In the Inspector, you'll see the following settings:
Id: The unique identifier for the product (e.g., "CoinsProduct1")
Product Type: Set to "Consumable"
Example for CoinsProduct1:
Id: CoinsProduct1
Product Type: Consumable
To set up the No Ads product:
Select the "NoAds" product in the Project window.
In the Inspector, configure the following:
Id: Set to "noAds"
Product Type: Set to "Non Consumable"
Unique Identifiers: Ensure each product has a unique Id that matches the identifier in your app store console (Google Play Store, Apple App Store, etc.).
Consumable vs Non-Consumable: Double-check that coin products are set as "Consumable" and the No Ads product is set as "Non Consumable".
Naming Convention: Maintain a clear naming convention for easy management, especially if you plan to add more products in the future.
Version Control: Keep these product definitions under version control to track changes over time.
Store Integration: Ensure your game's store UI references these product Ids correctly when initiating purchases.
Purchase Validation: Implement proper purchase validation logic in your game to verify and process these products when purchased.
Store Listing: Update your app store listings with the corresponding product information, ensuring the Ids match exactly.
These product definitions are used by Unity's IAP system to manage in-app purchases. Make sure you have the Unity IAP package installed and properly configured in your project.
By following this setup, you'll have a structured system for managing in-app purchases in your Spot the Difference game, allowing players to buy coins and remove ads seamlessly.