Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. 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. el_Guero

    el_Guero

    Joined:
    Sep 15, 2017
    Posts:
    168
    I never had problems before when using different engines and Restore always works on both, development builds and Diawi in Sandbox mode. Might be worth it to double check. Switched to Easy Mobile Pro and got everything working. Pretty sure it's a bug in Easy IAP or maybe in the Playmaker actions?
     
  2. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    I will check it out, Thank you for reporting.
     
  3. poolofclay33

    poolofclay33

    Joined:
    Oct 4, 2016
    Posts:
    51
    Hello! Just want to say that your plugin has helped me out a lot! However, I ran into an issue with reloading the current scene.

    I'm trying to make a non-consumable purchase and when I first enter play mode, and make my purchase, everything seems to be working accordingly. But when I restart the scene after I enter play mode (I'm using a button that uses "SceneManager.LoadScene" to reload the current scene), it shows that I have no products available to purchase and so my purchase button doesn't work like it does when you first enter play mode.

    I tested this in the "TestIAP" example scene and the same thing happens. Any help is much appreciated, thanks!
     
  4. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    First of all, please test your products on a live app downloaded from the store as a tester.
    If the issue persists, please send me a demo project with that error to be able to reproduce it at gley.assets@gmail.com.
    Thank you!
     
  5. tooinapps

    tooinapps

    Joined:
    Feb 13, 2017
    Posts:
    1
    I have the same issue as poolofclay33. Out of the box TestIAP scene in the live app, if I reload the scene, the products disappear and don't reload. I tested in unity editor and on iPhone. Please, help, thank you
     
  6. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    That scene is only working on first use. If you reload it it will not display the products because the store is already initialized inside the app. It works as intended. That scene is not made for production, is made to test if you correctly integrated the SDK and your Google Play dashboard. If you are able to see productis at first run your integration is correct.
    You should check the tutorials on how to implement IAP in a live game.
     
  7. juiced12

    juiced12

    Joined:
    Nov 8, 2018
    Posts:
    44
    @GleyGames I've been using your plugin for a while now. I've recently started working on my project again after a few months hiatus and I've upgraded the project to the latest unity 2020 LTS version. I've updated your asset to the latest version.

    I'm getting an error when attempting to mock purchase in the unity editor. I get the fake ui window popping up to ask me to buy, however when I click buy an error is thrown

    Code (CSharp):
    1. NotImplementedException: The method or operation is not implemented.
    2. UnityEngine.Purchasing.Security.GooglePlayTangle.Data () (at Assets/Scripts/UnityPurchasing/generated/GooglePlayTangle.cs:15)
    This is only happens when I use the receipt validation which I want to work. I have grabbed my key from the google play developer console and successfully added it to the project so I don't believe this to be the issue.

    Any ideas?
     
  8. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Receipt validation will always fail on test purchase because you will get fake receipts that are meant to fail, because are not real. So you cannot test receipt validation unless you test it on a real device.

    As you can see from your error, the error comes from the Unity SDK so make sure you are using the verified version of purchasing for your unity version.
     
  9. juiced12

    juiced12

    Joined:
    Nov 8, 2018
    Posts:
    44
    Hi Gley. Thanks for replying.
    So I am using the correct verified version. Is it safe to assume I can ignore the error in this case? I'd have thought they would realise that this would fail in the editor and wouldn't throw an error?
     
  10. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    It is strange that it throws an error. For your safety you can send an e-mail to Unity support. I am sure they know a fix for that.
     
  11. juiced12

    juiced12

    Joined:
    Nov 8, 2018
    Posts:
    44
    I'll look into this. Thankyou
     
  12. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    If for the solution some changes are required inside my plugin let me know and i will fix them.
    Thank you!
     
  13. nikunjk21

    nikunjk21

    Joined:
    Jan 12, 2014
    Posts:
    26
    Hi @GleyGames

    I'm facing problems while setting up IAP.
    After clicking on Save button in Easy IAP window I got errors:

    Assets\GleyPlugins\EasyIAP\Scripts\IAPManager.cs(13,30): error CS0234: The type or namespace name 'Security' does not exist in the namespace 'UnityEngine.Purchasing' (are you missing an assembly reference?)
    Assets\GleyPlugins\EasyIAP\Scripts\IAPManager.cs(354,12): error CS0246: The type or namespace name 'SubscriptionInfo' could not be found (are you missing a using directive or an assembly reference?)
    Assets\GleyPlugins\EasyIAP\Scripts\IAPManager.cs(612,65): error CS0246: The type or namespace name 'IAPSecurityException' could not be found (are you missing a using directive or an assembly reference?)

    I imported IAP sdk through Package Manager.
     
  14. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello, your Unity IAP package was not properly installed. please check this video:
     
  15. nikunjk21

    nikunjk21

    Joined:
    Jan 12, 2014
    Posts:
    26
    It is saying you're up to date with version. I've installed the Unity IAP with services window.

    upload_2021-6-25_13-24-35.png

    And I didn't find folder named 'UnityPurchasing' under Plugins folder. But It is present in your YT tutorial.
    upload_2021-6-25_13-26-4.png

    These is my version of folders.
    upload_2021-6-25_13-28-41.png upload_2021-6-25_13-29-10.png
     
  16. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    Please uninstall Unity IAP completely, make sure you do not have any errors inside your console and install the latest version of IAP available from package manager or for Services window.

    Sometimes Unity fails to properly install IAP i do not know why.
    If you still have issues send me an e-mail at gley.assets@gmail.com with your invoice number and I will send you a complete project with the Unity IAP already installed.

    image_2021-06-25_112705.png
     
  17. nikunjk21

    nikunjk21

    Joined:
    Jan 12, 2014
    Posts:
    26
    Errors are fixed!

    Problem was, when we import Unity IAP plugin from Package Manager, the default version was 2.2.2
    So I just upgraded it to 3.2.2 (latest one)

    upload_2021-6-29_0-31-24.png
     
  18. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Glad you managed to fix your errors.
     
  19. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    I'm having a problem also. Every time I follow your YT guide on how to implement IAP for Android, I keep getting this: IapManager does not contain a definition for instance". Do you know what that means?

    Edit: Nevermind about the above, I solved it. New problem.

    I can't get "InitComplete" to work.

    Edit again: I think I got it to work by using:
    InitComplete(IAPOperationStatus status, string errorMessage, List<StoreProduct> storeProducts)
     
    Last edited: Jul 6, 2021
  20. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Glad you managed to solve your issues
     
    kmshadowking likes this.
  21. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    I did, but then I ran into another problem. On your YT tutorial Part 6, the way I wrote the the code didn't work, and the method was unable to be called so I could attach it tho the button. Could you please help?
     
  22. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    This is the biggest problem that I'm having right now. Trying to get "Public void Buy Chapter" to work in the "On click event. It won't register/show up.

    Also, could you show me how to implement multiple non-consumable IAP's?
    Thanks.
    Code (CSharp):
    1. public class ShopMenu : MonoBehaviour
    2. {
    3.     public Text buyChapter11Text;
    4.     public Text buyChapter12Text;
    5.     public Text buyChapter13Text;
    6.     public Text buyChapter14Text;
    7.     public Text buyChapter15Text;
    8.     public GameObject mainMenu;
    9.  
    10.     public void BuyChapter()
    11.     {
    12.         IAPManager.Instance.BuyProduct(ShopProductNames.UnlockCH11, ProductBought);
    13.     }
    14.  
    15.     private void OnEnable()
    16.     {
    17.         buyChapter11Text.text = "Unlock Ch11" + IAPManager.Instance.GetLocalizedPriceString(ShopProductNames.UnlockCH11);
    18.  
    19.         buyChapter12Text.text = "Unlock Ch12" + IAPManager.Instance.GetLocalizedPriceString(ShopProductNames.Ch12);
    20.  
    21.         buyChapter13Text.text = "Unlock Ch13" + IAPManager.Instance.GetLocalizedPriceString(ShopProductNames.Ch13);
    22.  
    23.         buyChapter14Text.text = "Unlock Ch14" + IAPManager.Instance.GetLocalizedPriceString(ShopProductNames.Ch14);
    24.  
    25.         buyChapter15Text.text = "Unlock Ch15" + IAPManager.Instance.GetLocalizedPriceString(ShopProductNames.Ch15);
    26.  
    27.     }
    28.  
    29.     public void BackButtonPressed()
    30.     {
    31.         gameObject.SetActive(false);
    32.         mainMenu.SetActive(true);
    33.     }
    34.  
    35.  
    36.  
    37.     private void ProductBought(IAPOperationStatus status, string errorMessage, StoreProduct boughtProduct)
    38.     {
    39.         if (status == IAPOperationStatus.Success)
    40.         {
    41.             if(boughtProduct.productName == ShopProductNames.UnlockCH11.ToString())
    42.             {
    43.                 if (boughtProduct.productName == ShopProductNames.UnlockCH11.ToString())
    44.                 {
    45.                     Save.UnlockChapter(true);
    46.                 }
    47.             }
    48.         }
    49.     }
     
    Last edited: Jul 7, 2021
  23. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    Select the button in your hierarchy, there should be a "Button" component on the inspector. Add a new entry (+ symbol) in the "On Click()"-List. Now you have to drag the GameObject with the attached script into the new entry field, after that you will be able to select a function which will be called everytime you clicking the button.

    To implement multiple non consumable do the same thing for each one.
    I do not know exactly what is your question.
     
  24. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    Update. I was able to get the iap working in the unity editor, but now when I test it from building and running it on my device from unity, I get the product to register, but then it says "the item you requested is not available for purchase." I have the app in the alpha stage, but it still is in review. So I 'm waiting for it to go through. Does this mean I did everything right on Unity's side, and now I just have to wait for Google to do their part?

    Thanks.
     

    Attached Files:

    Last edited: Jul 7, 2021
  25. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    I was able to get the iap working in the unity editor, but now when I test it from building and running it on my device from unity, I get the product to register, but then it says "the item you requested is not available for purchase." I have the app in the alpha stage, but it still is in review. So I 'm waiting for it to go through. Does this mean I did everything right on Unity's side, and now I just have to wait for Google to do their part?

    Another thing, When I test it on my device from google, I get the old builds. Do you know why?
     
  26. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    To be able to test your product your app needs to be downloaded from a google play test track using your test user. The first build needs to be approved by the review team to be available for download.
    Also please make sure that only the last build is available and the old ones are disable from your play console. When you upload a nea build make sure 100% rollup is selected.
     
  27. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    Update. The app is now out of review and it is still saying the purchase is unavailable.
     
  28. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Please make sure your IDs are correct.
    This tutorial might help you to correctly set your products:


    If you still have issues you can create a test build with the scene provided in the package and add me as a tester using gley.mobi@gmail.com and send me your test link.
     
    kmshadowking likes this.
  29. kmshadowking

    kmshadowking

    Joined:
    Jul 24, 2018
    Posts:
    14
    Thank you. I appreciate the offer. I was finally able to get the pop-up to show during the closed alpha on android.
     
    GleyGames likes this.
  30. ColonelKurt

    ColonelKurt

    Joined:
    Jun 15, 2020
    Posts:
    17
    Hey man! How did you fix it?
     
  31. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Please make sure your app is downloaded from google play using your test used and that your IDs are correct.
     
    ColonelKurt likes this.
  32. ColonelKurt

    ColonelKurt

    Joined:
    Jun 15, 2020
    Posts:
    17
    Thank you, but I downloaded my app from Google Play testing and checked IDs, and it still shows this error. When I check Easy IAP debug in the editor it lists every item name as "Fake title" after successful initialization. Should it get correct title names in the editor too or only Google Play version?
     
    Last edited: Jul 23, 2021
  33. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    IAP only works inside real app downloaded from the store. In editor are only placeholders to be able to test your implementation. But if it works in editor your problem is with configuration from the store.
    Please check this tutorial and see what error messages do you get on your device. They will help you fix your issue:
     
    ColonelKurt likes this.
  34. ColonelKurt

    ColonelKurt

    Joined:
    Jun 15, 2020
    Posts:
    17
    Thank you, I'll try this one.
     
  35. ColonelKurt

    ColonelKurt

    Joined:
    Jun 15, 2020
    Posts:
    17
    Finally fixed it, the issue was with Google Play account.
     
    GleyGames likes this.
  36. dragonikus

    dragonikus

    Joined:
    Sep 29, 2010
    Posts:
    4
    Hi! I updated GleyPlugins to latest version (1.4.17), then updated GoogleMobileAds (6.1.2). Unity 2021.2.0b16. Before that everything was fine on same unity version (with gleyplugins and googlemobileads past versions) but now is compile errors.
    upload_2021-10-24_10-26-50.png
    Thanks for help.
     

    Attached Files:

  37. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    Please make sure your Unity IAP is up to date. If the issue persists let me know.
     
  38. bagmanio

    bagmanio

    Joined:
    Mar 15, 2021
    Posts:
    2
    Interested in buying the IAP. Could you please clarify, my app is intended for kids and AppStore has special requirements for the apps for kids. Does it have any problems with the approval by AppStore. Does it meet AppStore's requirements for apps for kids? Thank you!
     
  39. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    First of all make sure your app meets all the required conditions for app designed for kids. Usually IAP is not the best option to monetize such apps because kids are not allowed to buy products inside the app. but is your app design and it is not my business. For the IAP no special conditions are needed all the conditions needed have to be implemented by you from your app design and development.

    In conclusion, if you are a beginner I do not recommend you to buy Easy IAP because my documentation does not cover all the aspects of children directed apps that you need to do on your own inside your app in order for your app to be accepted.

    Thank you!
     
  40. Avinash_1

    Avinash_1

    Joined:
    Feb 8, 2021
    Posts:
    2
    hello,
    I tried to purchase subscription in iPod iOS 15.1 device.
    After purchase is successful the success callback is not calling itself..
     
  41. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    Please make sure you are using the latest version of Unity IAP and that your xCode is up to date.
     
  42. Avinash_1

    Avinash_1

    Joined:
    Feb 8, 2021
    Posts:
    2
    Version which i am using to test:
    Unity : 2019.2.21f
    Unity IAP :2.2.2
    MacOS :10.15.7 (Catalina)
    Xcode : 12.4

    My MacOS version is older and not supporting to update to latest version and cannot install to latest version of Xcode.
    InApp purchase like consumable and non consumable is working fine and i am getting Purchasesuccess callback.
    but for subscription successful transaction i am not getting any Purchasesuccess callback only in IOS 15.1 device.
    please reply fast.
     
  43. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    For subscription you need at least IAP version 3.0.0 but for the latest devices I recommend you to use Unity IAP above 4.0.0

    Since you are using an old version of IAP I cannot help you because that version is obsolete and the callbacks work properly on the latest versions of the plugin.

    My personal recommendation is to use Unity 2019 LTS for releasing games, always release your game with a LTS version of Unity
     
  44. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    I purchased your plugin yesterday and it's unbelievable, so great work for so low price! I will definitely buy some other your plugins, everything works like a charm.

    I have a questions regarding the initialization

    Code (CSharp):
    1. //call this method only once at the beginning of the game to initialize product information.
    2. IAPManager.Instance.InitializeIAPManager(InitializeResultCallback);
    My game consist of several scenes, should I
    1. Initialize plugin on each scene
    2. Initialize on the "preload" scene only
    3. Initialize on the "preload" scene only and keep it as Singleton "undestroyed" through all scenes
    4. Your own way

    Please circle the correct way :)

    What will happen if I initialize twice or even more times by mistake/or intentionaly?
     
    Last edited: Dec 19, 2021
  45. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    The plugin needs to be initialized only once at the beginning of your game(preload scene in your case). Then a static variable is automatically generated and can be used through your entire project using IAPManager.Instance

    I hope now it is more clear to your. Let me know if you need more help.
     
  46. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83

    It's pretty clear now.

    Does initializer require internet connection to retrieve active purchases from google store? In case yes, then let's assume that user opened the app while being offline(e.g. initializer failed). Can I re-call initializer later when user is online again?
     
  47. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    You do not need to call initialize again, it is a background process, it should initialize when the connection is on.
     
  48. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    I'm lost. If there is no internet connection, can I initialize it?
     
  49. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    You can call the initialize but nothing will happen, the process will just wait for the internet connection.
     
  50. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    I will initialize but callback function will be execute only once there is internet connection, even after 10 mins?