Easy IAP - Make money from your game

Easy IAP (In App Purchase)
Make money from your game
3790552--317989--large.jpg

Get it now from Asset Store
For detailed implementation instructions see the Documentation

Key features:

  • Make in app purchases with minimal setup and very little programming knowledge.
  • Same code for all supported platforms.
  • Just import Easy IAP and add your product IDs and all is done.
  • Can be tested using Unity Editor.
  • Support for Consumable. Non-Consumable and Subscriptions.
  • Easy setup for in app products using a custom made Setttings Window.
  • Works with Unity 5.3 and above and with Free, Plus or Pro versions of Unity.

Currently supported platforms:

  • Google Play
  • App Store (iOS)
  • Amazon Store

Easy setup from a custom Editor Window:

3790552--318001--addProducts.jpg

Simple methods to make a purchase that work for all platforms:

  • Initialize plugin
//call this method only once at the beginning of the game to initialize product information.
IAPManager.Instance.InitializeIAPManager(InitializeResultCallback);

//this method will be called after initialization process is done
private void InitializeResultCallback(Status status, string message, List<StoreProduct> shopProducts)
{
     if (status == Status.Success)
     {
          //IAP was successfully initialized
          //loop through all products
          for (int i = 0; i < shopProducts.Count; i++)
          {
               if (shopProducts[i].productName == "YourProductName")
               {
                    //if active variable is true, means that user had bought that product
                    //so enable access
                    if (shopProducts[i].active)
                    {
                         yourBoolVariable = true;
                    }
               }
          }
     }
     else
     {
          Debug.Log(“Error occurred ”+ message);
     }
}
  • Buy product
IAPManager.Instance.BuyProduct(ShopProductNames.YourProductName, ProductBoughtCallback);

// automatically called after one product is bought
// this is an example of product bought callback
private void ProductBoughtCallback(Status status, string message, StoreProduct product)
{
     if (status == Status.Success)
     {
          //each consumable gives coins in this example
          if (product.productType == ProductType.Consumable)
          {
               coins += product.value;
          }

          //non consumable Unlock Level 1 -> unlocks level 1 so we set the corresponding bool to true
          if (product.productName == "UnlockLevel1")
          {
               unlockLevel1 = true;
          }

          //subscription has been bought so we set our subscription variable to true
          if (product.productName == "Subscription")
          {
               subscription = true;
          }
     }
     else
     {
          //an error occurred in the buy process, log the message for more details
          Debug.Log("Buy product failed: " + message);
     }
}
  • Restore Purchases
//only required for iOS App Store
//restores previously bought products
//this is also done automatically every time at initialize
IAPManager.Instance.RestorePurchases(ProductRestoredCallback);

// this is an example of product restored callback
private void ProductRestoredCallback(Status status, string message, StoreProduct product)
{
     if (status == Status.Success)
     {
          //consumable products are not restored
          //non consumable Unlock Level 1 -> unlocks level 1 so we set the corresponding bool to true
          if (product.productName == "UnlockLevel1")
          {
               unlockLevel1 = true;
          }

          //subscription has been bought so we set our subscription variable to true
          if (product.productName == "Subscription")
          {
               subscription = true;
          }
     }
     else
     {
          //an error occurred in the buy process, log the message for more details
          Debug.Log("Buy product failed: " + message);
     }
}

For a complete list of methods check the Documentation
Any suggestions are always welcome, we will consider them for future updates.
We also made some tutorials on how to test your products on Google Play:
https://www.youtube.com/watch?v=njERM-b7Ub4
And also for iOS:
https://www.youtube.com/watch?v=p4_lhiVbErA
We also made a detailed step by step tutorial on how to create IAP products, upload builds to alpha, test IAP products and create a basic shop in your game. Here is a complete playlist:
https://www.youtube.com/playlist?list=PLKeb94eicHQumyCLcJbprEgOhyKc2Q7EQ

Version 1.1.0 in now available on Asset Store

Changes in this version:

  • Fixed compatibility issue with other external packages. Now the plugin is compatible with all other plugins used in your app.

  • Minor fixes in settings window.

I not sure how RestorePurchase works.
If user bought more both UnlockLevel1 and Subscription (from example above) then when this command call

IAPManager.Instance.RestorePurchases(ProductRestoredCallback);

Which product will restore the purchase?

Hello,

Thank you for your interest in our plugins.

If you call this method it will be restored all product marked as Non Consumable and Subscription.
The product marked as consumable are not restored.

1 Like

Hello,
We just extended our plugin with Amazon support.
You can get it now from the Asset Store

2 Likes

Hi,

I have bought 2 of your plugins (Easy IAP and Easy Achievements and Leaderboards),

I have followed your instructions to the letter and everything builds fine but once the app is deployed to an Android device the game starts and attempts to access google services I get the App has stopped working message.

Can you provide any assistance on how to resolve the issue?

Thanks in advance,

Terry

Hello,
Thank you for using our plugins.
Please connect your app to Android monitor and see what is the reason for the crash then let us know.

If that is not possible please ad us as a tester for your app using gley.mobi@gmail.com e-mail address and send us your test link and we will debug your app for you to see what went wrong with your implementation.

Thanks for the quick reply :slight_smile: I have used the Android Monitor and found the APPID was incorrectly configured in the manifest file, in the manifest file the APPID starts with \ but it needs to start with \u003. The Easy Achievements is working like a treat now, next up Easy IAP :slight_smile:

We are glad you managed to solve your problem. Let us know if you need more support from us.
Good luck with your game!

We just released a step by step tutorial about testing your In App Products on Amazon Store

Hello,
You have to reimport Unity IAP. Sometims it fails to install correctly. Please check this tutorial at 1.17.

We just added Bolt support in our asset.
Here is a full integration tutorial:

1 Like

We just added Game Flow support on our asset.
You can find here the full tutorial:

So what about Upgrade and Downgrade for Subscription based IAPs? Im not seeing a function with this…

What do you mean by upgrade or downgrade subscription IAP, please provide more info about what you intend to do.

ITunes states that any IAP that contains more than one needs to be upgradable. So, if i am subscribed to a 0.99$ subscription and there is a second sub i can get for 9.99$ there must be a function that allows me to upgrade to that 9.99$ sub. So if i sub to the 9.99 i then get out of my 0.99 sub at the end of the billing cycle and enter into a new sub for 9.99. Your asset doesnt have this feature. There is no way to detect this. There has to be a way to detect receipts and upgrade this. Itunes says its a thing cause our app got denied cause we didnt have an upgrade feature.

Sorry,
What you are asking is not possible with Unity IAP, or I did not understand correctly what you ware asking. Subscriptions cannot be linked one to another and what you are asking is a store feature not an app feature. It is possible to get the info from the receipt but your subscriptions became active in the moment is purchased because the store provides that info, it cannot be altered at the app level to be active after the previous subscription(another one) expires.
We cannot help you in this problem, send us an e-mail at gley.assets@gmail.com with your invoice number and we will offer you a refund.

Hi~
My game is a premium app for now. I plan to switch to free and start IAP in the future. But I will still need to recognize if the player has paid for my game. How can I use EasyIAP to check the receipt. I don’t know how to code, but I know how to use playmaker. Could you offer me a step by step tutorial or some direction? Thank You~

Hello,
Sorry,
Currently I never done that before. As I read if your app is started as payed app, it is not possible to make it free(I might be wrong). Unity IAP is used for In App Purchase. If your user bought your app that not counts as an In App Purchase and it cannot be checked using Unity IAP you have to check it using another APIs.
I might be wrong. Please inform yourself about what exactly do you need and if it is possible using our plugin we will help you but for the moment I think that what you ask is not possible from an IAP plugin.

Thank you for the answer~
I read that you can validate the receipt locally. So I think if can get the original purchased app version info from the receipt, I can recognize the player paid for the app or not. Can I use EasyIAP to do that?