Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Easy IAP - Make money from your game

Discussion in 'Assets and Asset Store' started by GleyGames, Oct 16, 2018.

?

What other platforms we should create support for?

  1. Amazon Apps

  2. Amazon Underground

  3. CloudMoolah Store

  4. Mac App Store

  5. Samsung GALAXY Apps

  6. Tizen Store

  7. Windows Store

Multiple votes are allowed.
Results are only viewable after voting.
  1. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Easy IAP (In App Purchase)
    Make money from your game
    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:

    addProducts.jpg
    Simple methods to make a purchase that work for all platforms:
    • Initialize plugin
    Code (CSharp):
    1. //call this method only once at the beginning of the game to initialize product information.
    2. IAPManager.Instance.InitializeIAPManager(InitializeResultCallback);
    3.  
    4. //this method will be called after initialization process is done
    5. private void InitializeResultCallback(Status status, string message, List<StoreProduct> shopProducts)
    6. {
    7.      if (status == Status.Success)
    8.      {
    9.           //IAP was successfully initialized
    10.           //loop through all products
    11.           for (int i = 0; i < shopProducts.Count; i++)
    12.           {
    13.                if (shopProducts[i].productName == "YourProductName")
    14.                {
    15.                     //if active variable is true, means that user had bought that product
    16.                     //so enable access
    17.                     if (shopProducts[i].active)
    18.                     {
    19.                          yourBoolVariable = true;
    20.                     }
    21.                }
    22.           }
    23.      }
    24.      else
    25.      {
    26.           Debug.Log(“Error occurred ”+ message);
    27.      }
    28. }
    • Buy product
    Code (CSharp):
    1. IAPManager.Instance.BuyProduct(ShopProductNames.YourProductName, ProductBoughtCallback);
    2.  
    3. // automatically called after one product is bought
    4. // this is an example of product bought callback
    5. private void ProductBoughtCallback(Status status, string message, StoreProduct product)
    6. {
    7.      if (status == Status.Success)
    8.      {
    9.           //each consumable gives coins in this example
    10.           if (product.productType == ProductType.Consumable)
    11.           {
    12.                coins += product.value;
    13.           }
    14.  
    15.           //non consumable Unlock Level 1 -> unlocks level 1 so we set the corresponding bool to true
    16.           if (product.productName == "UnlockLevel1")
    17.           {
    18.                unlockLevel1 = true;
    19.           }
    20.  
    21.           //subscription has been bought so we set our subscription variable to true
    22.           if (product.productName == "Subscription")
    23.           {
    24.                subscription = true;
    25.           }
    26.      }
    27.      else
    28.      {
    29.           //an error occurred in the buy process, log the message for more details
    30.           Debug.Log("Buy product failed: " + message);
    31.      }
    32. }
    • Restore Purchases
    Code (CSharp):
    1. //only required for iOS App Store
    2. //restores previously bought products
    3. //this is also done automatically every time at initialize
    4. IAPManager.Instance.RestorePurchases(ProductRestoredCallback);
    5.  
    6. // this is an example of product restored callback
    7. private void ProductRestoredCallback(Status status, string message, StoreProduct product)
    8. {
    9.      if (status == Status.Success)
    10.      {
    11.           //consumable products are not restored
    12.           //non consumable Unlock Level 1 -> unlocks level 1 so we set the corresponding bool to true
    13.           if (product.productName == "UnlockLevel1")
    14.           {
    15.                unlockLevel1 = true;
    16.           }
    17.  
    18.           //subscription has been bought so we set our subscription variable to true
    19.           if (product.productName == "Subscription")
    20.           {
    21.                subscription = true;
    22.           }
    23.      }
    24.      else
    25.      {
    26.           //an error occurred in the buy process, log the message for more details
    27.           Debug.Log("Buy product failed: " + message);
    28.      }
    29. }
    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:


    And also for iOS:


    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



     
    Last edited: May 7, 2019
  2. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    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.
     
  3. Adswars

    Adswars

    Joined:
    Jun 28, 2015
    Posts:
    13
    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?
     
  4. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    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.
     
    Adswars likes this.
  5. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    We just extended our plugin with Amazon support.
    You can get it now from the Asset Store
     
    Mailjitu and Adswars like this.
  6. violentlemming

    violentlemming

    Joined:
    Nov 14, 2015
    Posts:
    4
    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
     
  7. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    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.
     
  8. violentlemming

    violentlemming

    Joined:
    Nov 14, 2015
    Posts:
    4
    Thanks for the quick reply :) 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 :)
     
  9. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    We are glad you managed to solve your problem. Let us know if you need more support from us.
    Good luck with your game!
     
  10. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    We just released a step by step tutorial about testing your In App Products on Amazon Store
     
  11. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    You have to reimport Unity IAP. Sometims it fails to install correctly. Please check this tutorial at 1.17.
     
  12. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    We just added Bolt support in our asset.
    Here is a full integration tutorial:
     
    Mauri likes this.
  13. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    We just added Game Flow support on our asset.
    You can find here the full tutorial:
     
  14. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    60
    So what about Upgrade and Downgrade for Subscription based IAPs? Im not seeing a function with this..
     
  15. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    What do you mean by upgrade or downgrade subscription IAP, please provide more info about what you intend to do.
     
  16. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    60
    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.
     
  17. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    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.
     
  18. Shi-Chi

    Shi-Chi

    Joined:
    May 20, 2014
    Posts:
    10
    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~
     
  19. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    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.
     
  20. Shi-Chi

    Shi-Chi

    Joined:
    May 20, 2014
    Posts:
    10
    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?
     
  21. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    60
    No we are stil going yo use it. But ios says that any app that offers more than 1 IAP that it must also include a way to either upgrade or downgrade. So like i said, if i have a subscription thats monthly and another that is yearly, and i buy the month sub but 2 months later i want to upgrade to the year sub, it should have that option.
     
  22. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    Currently we are not able to to test that because we are not used payed apps so for now that is not possible using our plugin. We are sorry.
     
  23. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    We found this thread:
    https://forum.unity.com/threads/google-play-subscription-upgrade-downgrade.528434/

    We will try to integrate it inside our plugin, but currently we are very busy, so only in April this might be supported.
     
    gaglabs likes this.
  24. Helolly

    Helolly

    Joined:
    Nov 8, 2017
    Posts:
    2
    hi, is there a purchasing check in your Easy IAP (In App Purchase) asset? (I mean protection against hacking, android at least)
     
  25. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    Our asset uses the Unity Verify invoice check. If you need more protection than that, do not buy it.
    Thank you!
     
  26. jasa23

    jasa23

    Joined:
    Oct 26, 2018
    Posts:
    7
    Hello, i followed the tutorial in order to import IAP and then unity IAP, but once I do this I get this error as well as the gleygames setting disappears. Is it a bug or did i import something in the wrong order? Just wanted to let you know. upload_2020-5-13_11-22-41.png
     
  27. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    It looks like your Unity IAP plugin was not installed properly. It happens sometimes.
    Please follow this tutorial:
     
  28. siumanchun

    siumanchun

    Joined:
    Apr 7, 2013
    Posts:
    36
    Hi ! Please Add IAP For Steam !
    Ťhank You !
     
  29. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    Currently Unity IAP does not support Steam purchases and our asset is dependent on Unity IAP so we cannot add it until unity officially supports it.
    Sorry
     
  30. AiR-Cord

    AiR-Cord

    Joined:
    Nov 15, 2018
    Posts:
    1
    Hello,
    If I cancel my subscription in the store, can I get the latest information (isCancelled) with the GetSubscriptionInfo method?
    (Can't get the latest information because Unity Purchasing is Singleton?)
     
    Last edited: May 25, 2020
  31. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    Our plugin uses the official unity IAP, the documentation is available here:
    https://docs.unity3d.com/Manual/UnityIAPSubscriptionProducts.html
    The singleton has nothing to do with this.
     
  32. gaglabs

    gaglabs

    Joined:
    Oct 17, 2019
    Posts:
    60
    With unity 2019.4.f01 there is no longer a Gley option in Window tab. So how do i access it??
     
  33. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    Please make sure you do not have any errors inside your console so the scripts can compile, and the menu will be available again.

    Let us know if you need more help
     
  34. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    325
    Hey, it looks like Gley doesn't compile correctly against the current (package distributed) versions of Unity IAP from Unity 2019.4.x. And getting the Unity Editor to have IAP enabled and download the asset store (rather than package-based) IAP is really quite tricky.

    Your video shows that it works great in Unity 5.6.5, which is great, but is there any chance you can make a corresponding one for 2019? Or update so that it works with the current IAP package?
     
  35. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Hello,
    I can confirm that IAP works with Unity 2019.4.2 latest version of Unity. What errors do you get?
     
  36. ferretnt

    ferretnt

    Joined:
    Apr 10, 2012
    Posts:
    325
    Working now in 2019.4.2 after importing Easy IAP into a project that already had Unity IAP set up with our own purchase script. Not sure what was going on yesterday, but assume it was our fault. Thanks.
     
  37. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    242
    Maybe you had the issue we covered in this tutorial:
     
unityunity