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. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    If the unity guys didn`t changed their system lately, yes.
     
  2. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    Thank you very much for your patience answering my questions! It's clear now.

    Merry Christmas!
     
  3. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    Btw, in your videos I saw that you are doing test purchases using "Test card, always approves". I tried to followe the steps on google, e.g.

    1. Open Play Console.
    2. Click Setup > License testing.
    3. In "Add license testers" box, enter your testers' Gmail addresses. (I chose "LICENSED" for email)
    4. In the bottom right corner of the screen, select Save changes
    5. (I uploaded a new version of the apk after licensing test user)

    But that test card didn't appear in my card list. Did I miss any step? It doesn't to your topic, but I didn't know that such card exist and I saw it your videos. If you be so kind to drop couple of advises how to fix it.
     
  4. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    Maybe this official documentation might help you. The Google Play team changes this a lot.
    https://support.google.com/googleplay/android-developer/answer/6062777?hl=en
     
    jeremy_crowell likes this.
  5. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    The link you sent perfectly works. The only thing which made me stacked for days - once you put the test email, don't forget to hit "Enter" before hitting button "Save". It could be an issue for others.
     
  6. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    If the user buys consumable product but closes the app before the callback is executed. Is there any chance to retrieve data with your plugin at the application start and grant user with related consumable value?
     
  7. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    After the product bought callback is called, the consumable is marked as consumed. If it was not marked as consumed it works in the same way as a non consumable product, you you can get the state in initialize.
     
    jeremy_crowell likes this.
  8. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83

    1 And how can I know that consumable product was already consumed or not? Do I have any access to receipt of order or something like that?

    2 Btw, how can I get subscription info right after purchase?
    Code (CSharp):
    1. SubscriptionInfo info = IAPManager.Instance.GetSubscriptionInfo(ShopProductNames.product_id);
    Subscription info is available only after initialization. Re-intiallization is "blocked".

    Please kindly advise and thank you very much for your patience.
     
  9. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    1. Your question is a hard one. But I will explain it as simple as I can.

    From the official Unity docs says that when the PurchaseProcessingResult.Complete is called the product is consumed.
    https://docs.unity3d.com/Manual/UnityIAPProcessingPurchases.html

    If the PurchaseProcessingResult.Complete is not called by some exceptional conditions(honestly never happen in my apps) you will need to manually verify the product like this:
    Product product = m_StoreController.products.WithID(shopProducts.GetStoreID());
    if (product != null && product.hasReceipt)
    {
    if (ReceiptIsValid(shopProducts.productName, product.receipt, out exception))
    {
    //do your thing
    PurchaseProcessingResult.Complete;
    }
    }

    2. you can query the subscription info inside your game in any place you want as long as the IAP is initialized.
     
  10. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    I will dig the info regarding the first part of your answer. Your answers are always helpful and being key for the correct direction.

    ****

    As for the second "quoted" part, calling the subscription right after purchase (we assume that initialization is already done some times ago) will return null.

    I mean following code will return null
    Code (CSharp):
    1. SubscriptionInfo info = IAPManager.Instance.GetSubscriptionInfo(ShopProductNames.correct_product_id);
    Query will return data of subscription only on the stage of initialization.


    In simple words:
    1 user opens app (plugin is initialized)
    2 user makes subscription ("info" query will return null)
    3 user restarts app ("info" query will return full subscription data)
    4 without restart query will be always null
     
  11. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    45
    Hello. I have emailed support, but thought would post here in case someone else on the forum has solved my issue.

    I have received the note below from the Apple app store submission - Rejection (they’ve accepted the app previously with nothing changed in this area of it…).

    They mention an error which is one I display as the user enters the purchase screen, if IAPManager.Instance.IsInitialized() returns false. I prevent the purchase from being triggered and show a customer error to the effect that the IAP routine isn't initialised. My app initialises the IAPManager in the first logo scene. it logs any error that results from this, but in all my testing, it has never failed to initialise for me, in test or previous production release.

    Apple below seem to have assumed this is an issue because IAPManager does not, in a production build, try to validate a receipt in both their production environment and if that fails their test environment also. Maybe it is that - I simply don't know. Any help to trouble shoot this would be appreciated.

    ------------
    "
    We found that your in-app purchase products exhibited one or more bugs when reviewed on iPad and iPhone running iOS 15.3.1 on Wi-Fi.

    Specifically, after we tapped on the Purchase/Restore button, we received an error message.


    When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.
    "
    ----------------
     
  12. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    if you are using receipt validation, that will fail on apple sandbox at current time, because a test receipt is not considered a valid receipt. Apple changed their policy about receipt validation lately, so if you are using receipt validation it will fail the review. Please disable receipt validation until we manage to fix this issue.
    Thank you!
     
  13. Boliver0482

    Boliver0482

    Joined:
    Oct 19, 2019
    Posts:
    45
    Thank you. Have done so and resubmitted...
     
    GleyGames likes this.
  14. daniel6839

    daniel6839

    Joined:
    Dec 16, 2017
    Posts:
    14
    My app got rejectet too, I’m not sure is the same issue:

    “We found that your in-app purchase products exhibited one or more bugs when reviewed on iPhone running iOS 15.3.1 on Wi-Fi.

    - The Restore button was unresponsive

    When validating receipts on your server, your server needs to be able to handle a production-signed app getting its receipts from Apple’s test environment. The recommended approach is for your production server to always validate receipts against the production App Store first. If validation fails with the error code "Sandbox receipt used in production," you should validate against the test environment instead.“

    Tested on a real device with no problems.
    I’m not using receipt validation.
     
  15. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    These days I moved from 2018.4.1f1 to 2020.3.37f1. IAP gave me following warning: "Unity IAP: Unity In-App Purchasing requires Unity Gaming Services to have been initialized before use."

    Should I initialize it? Because with old unity version (2018.4.1f1) I just installed "Easy IAP plugin", didn't initialize anything and subscription/consumables worked fine.

    Please advise.

    P.S. It's more then half of the year since I'm using your plugin and it works like charm, consumables and subscriptions are going without any problem. Thank you for this.
     
    Last edited: Aug 19, 2022
  16. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello Jeremy,

    If you use my plugin, you only need to initialize it once like it says in my documentation (page 13 https://gleygames.com/documentation/Gley-EasyIAP-Documentation.pdf) and tutorials. My package is a wrapper to the Unity IAP and thus the other things are happening automatically (as you said " I just installed "Easy IAP plugin", didn't initialize anything and subscription/consumables worked fine").

    There should not be any significant differences between the implementation in this version of the Unity Editor. i.e. the guidance in the tutorials is still available even for newer versions (2021...)

    Furthermore, if you switch versions:
    • make sure that the other configurations are still set up, i.e. Enabling IAP from Unity Services (min 0:37
      ).
    • make sure you press Save/Apply settings in the Gley IAP window (it may sound obvious, but it is the most common mistake)
    • check to have the scripting symbols after you press that save button (image below) upload_2022-8-19_12-54-3.png
    I am super glad to hear that you enjoy using my work! I totally encourage and I would appreciate if you wrote a sincere review on the Asset Store.:)
     
  17. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    Sure, why not. I left two reviews. One review for "Easy IAP" and the second for new purchase "Mobile tools". I'm pretty sure the second purchase is also a good money investment and time saver! Thank you for doing good assets and selling for very very cheap! :)


    Regarding the earlier question. This is what I get.


    I doubled checked all the steps including "Script Compilation", everything is set up. Can I neglect this warning or should I enable it?
     
  18. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    Sorry for asking in this topic, can't find the related one but it's about your asset.

    In MobileAds asset you have following method "Advertisements.Instance.ShowRewardedVideo(CompleteMethod);"

    In case there is no video to show yet e.g. it's being downloaded, but user already clicked for reward. Will the advertising video automatically played later(once downloaded) or not?

    Your answer is very important. THANK YOU IN ADVANCE.
     
  19. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Yes, you cam neglect this warning because my asset does that automatically in case you made the guided setup.
     
  20. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Yes, it normally does. It should be played (once the method was called and the ad is available).

    In case you find it differently, I totally encourage you to send your test case to our support email because it has never happened to us or other customers and it will be interesting to investigate, if there is.
     
  21. robymv

    robymv

    Joined:
    Oct 28, 2013
    Posts:
    74
    Hello GleyGames, I am using this asset for the first time and it works fine. Purchases in my app work. My problem is that after the purchase of "noAds" it works the first time, if I restart the app the ads go back to their place.
    I see above a solution but it is not clear to me, could you write the whole complete function as an example to do this?
    A thousand thanks.
     
  22. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
  23. jeremy_crowell

    jeremy_crowell

    Joined:
    Jul 21, 2018
    Posts:
    83
    Thank you a lot for your awesome products!
     
  24. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello @robymv ,

    Please describe your scenario via the support email address gley.assets@gmail.com in order to understand your case and answer you on point. Include your invoice number in the first email, please.

    Have a nice day!
     
    robymv likes this.
  25. sc2aru

    sc2aru

    Joined:
    Jul 25, 2019
    Posts:
    2
    Hello Gley! I have the same issue @robymv described. On our test accounts and editor, a non-consumable return True (IAPManager.IsActive(productName)) only in session when user bought that product. In all other cases APManager.IsActive(productName) returns false, whatever user bought non-consumable in previous session.
     
  26. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello @sc2aru,

    1.Where did you test your app? What is the behavior on a real device? I just want to make sure that you did not mean pressing Play in the Unity Editor by "when I restart the application". You should test on a real device and see the behavior. The app should be downloaded from the store via tester's link, not only built from Unity.

    2.Please enable the debug mode in the Gley Window, add the testIAP scene included in my work. Check (on a real device) if the remove ad is true or false. A helpful tutorial I made is the following one, exactly on your case:


    If you want to store your saved values on a specific server, this is not implemented in my current package and thus you will need to implement it by yourself. However, if you use my implementation, you will update your in-app purchase products information on every single initialization of the game - meaning when you call IAPManager.Instance.InitializeIAPManager(InitializeResultCallback); page 13 in my documentation https://gleygames.com/documentation/Gley-EasyIAP-Documentation.pdf (I've made an example in the test scene as well), meaning that every time you will reopen your app (not from the background, on a real device) it will updated the information and it will know what products the user has.

    I hope I helped you!
     
  27. sc2aru

    sc2aru

    Joined:
    Jul 25, 2019
    Posts:
    2
    Thanks for reply! Yeah, we tested it on real device via testers link. I fixed that issue yesterday, I think error was on my side with code.
     
  28. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Alright. Congrats for finding the solution!

    If you use our package and enjoy our assistance, a review would be truly appreciated link_asset_store!

    Have a nice and fruitful day!
     
  29. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    To sum up, for those who encounter this problem as well:
    Make sure you assign to NoAds the characteristic of a non-consumable in the Gley window.

    Cheers!
     
  30. phzzyzhou

    phzzyzhou

    Joined:
    Nov 19, 2019
    Posts:
    1
  31. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,
    There is no implementation for Cloud Saving in the Gley package.
    If you need a refund due to this, let us know (gley.assets@gmail.com).
     
  32. pepsi4

    pepsi4

    Joined:
    Mar 1, 2016
    Posts:
    2
    Hello! I have some issues with initializing on IOS. I have tried your script "TestIAP" and it works perfect in the editor. But when I'm testing it on my iphone it`s even cannot be initialized. IAP v. 1.5.1 (IAP in xcode also included)
    (and yeah, IAP works perfect in Google Play).
     
  33. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello,

    To see ads you should test them on real devices.
    For IOS, please make sure your payment details are filled inside your Apple dashboard and all your tax related documents are accepted and signed. Before you do that your store products will not work, even in test mode. This is an Apple requirements.
    It's great our TestAds scene helped you! Continue with it after you complete the steps above.

    For similar questions and faster support, we encourage you to join our Discord IAP support channel (https://discord.com/invite/7eSvKKW) and check through the other community member's questions and curiosities.

    For other technical guidance, please provide more info (captures with the logs that appear on your device. For this enable the On screen debug mode in Gley Settings Window). Please include your Invoice Number in your emails as it is stated on the Asset Store page.

    If you enjoy our package, support and the work we put within the package, a review would be truly appreciated!:)

    Have a great week ahead!
     
  34. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    438
    Hi,

    Just a note here. If you encounter that error:

    Code (CSharp):
    1. Assets/GleyPlugins/EasyIAP/Scripts/IAPManager.cs(161,39): error CS1593: Delegate 'Action<bool>' does not take 2 arguments
    This happens in the RestorePurchases() method, under a new regional/version filter:
    Code (CSharp):
    1. #if UNITY_2020_3_OR_NEWER
    ...while working with a setup like this:
    • Unity 2021.3.19f1 LTS
    • Unity IAP 4.5.2
    • Gley Mobile Tools: Easy IAP 1.6.7
    As the script IAPManager was updated, try to update to Unity IAP 4.7 or higher and all things should proceed finely.
     
    GleyGames likes this.
  35. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Thank you, @Starbox for your contribution! It is really helpful and appreciated.
    Sharing is caring!:)
     
  36. nnsashann

    nnsashann

    Joined:
    Aug 10, 2018
    Posts:
    3
    Hello! Thanks for amazing asset! I have one simple question: I try to make subscription validation with PlayMaker. What I need use? Check If Bought? if so will it give NO if subscription expired? or it will give always give YES if subscription was bought once and can e inactive now.
     
  37. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    481
    Hello, check if bought will return true only if subscription is active. If it is expired or canceled or in other state, it will return false.
     
  38. nnsashann

    nnsashann

    Joined:
    Aug 10, 2018
    Posts:
    3
    Thanks for your fast answer!
     
  39. Starbox

    Starbox

    Joined:
    Sep 17, 2014
    Posts:
    438
    I found out that in Playmaker, on a mobile device, the action that initializes the IAP system will not trigger any event if there is no internet connection, so no flow will come out of the state.
    Obviously checking if a connection is available even before using Gley Mobile's functions is preferable for all sorts of reasons and not just using Gley Mobile's tools, but it might a good thing if internally, the IAPManager script would throw an initialization failure too when there is no connection instead of doing nothing, for the sake of commodity and easiness of use.