Integrating Unity In-App Purchases (IAP) with Unity for Android and iOS

Integrating Unity In-App Purchases (IAP) with Unity for Android and iOS

Set up and integrating Unity IAP
1) Install 'In App Purchasing' (com.unity.purchasing) package from Unity Registry in Package Manager.

2) Import our custom scripts & prefabs here.

Initialise Unity Gaming Services
1) Drag the _IAPInit.prefab to Splash scene

 

Initialise IAP
1) Drag the _IAP.prefab to the menu scene & game scene.

2) Enter your Android and iOS Consumable & Non Consumable product ID in each field.
3) Add the price texts of IAP buttons to localise.
4) Drag all the buy buttons to set interaction on/off based on IAP initialization & internet availability.
5) Drag all purchased images to enable after purchasing an item.
6) To buy a product, call MyIAPManager.instance.BuyProduct(MyIAPManager.instance.consumableProducts[1].productId, CallBackMethodName);

7) For restore purchases, call
MyIAPManager.instance.RestorePurchases();

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.