Cross-Platform IAP Store Page with Unity IAP in 2023 | Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 2 июн 2024
  • In this tutorial you'll learn step by step how to set up Unity IAP in 2023, create a cross platform product catalog, create a store page that will dynamically be created based on your IAP Catalog, and learn how to get this catalog submitted to Google Play and the Apple App Store.
    This video does NOT cover creating a developer account or creating your app on Google Play or the Apple App Store. If you need help with that, you can learn all about that for Google Play in this video: • Developer's Guide to R...
    💸 Ongoing sales 💸
    ⚫ Check out the latest Humble Bundles www.humblebundle.com/software...
    ⚫ Publisher Sale! 50% OFF an entire publisher's Assets! Publisher changes weekly! assetstore.unity.com/publishe...
    ⚫ Save up to 50% on NEW Assets: assetstore.unity.com/?new_sal...
    👨‍💻 As always, all code from this video is available on GitHub: github.com/llamacademy/unity-...
    📚 Resources:
    ⚫ Get your game on Google Play: • Developer's Guide to R...
    ⚫ Data Persistence: • Data Persistence - Sav...
    ⚫ Unity Dashboard: dashboard.unity3d.com/
    ⚫ Learn how to persist data in your game: ruclips.net/video/mntS45g8OK4/видео.html
    ⚫ Gun Icons came from this asset: assetstore.unity.com/packages...
    ⚫ Unity IAP Documentation: docs.unity3d.com/Packages/com...
    ⚫ Defining Products in Unity IAP: docs.unity3d.com/Packages/com...
    ⚫ Creating an IAP Catalog: docs.unity3d.com/Packages/com...
    ⚫ Purchase Flow: docs.unity3d.com/Packages/com...
    ⚫ Codeless IAP: docs.unity3d.com/Manual/Unity...
    ⚫ Unity Legacy Analytics: docs.unity3d.com/Manual/Unity...
    ❤ Believe in LlamAcademy's mission and have received value from the videos? Become a Patreon Supporter or RUclips Member:
    ⚫ Patreon: / llamacademy
    ⚫ RUclips Member: / @llamacademy or click the Join button on any video
    📱 Let's stay connected
    RUclips: / llamacademy
    Patreon: / llamacademy
    Facebook: / llamacademyofficial
    Twitter: / thellamacademy
    TikTok: / llamacademy
    Instagram: / llamacademy
    ----
    Most tutorials come from knowledge gained making survival.llama.software Llama Survival - a top-down zombie survival shooter for Android and iOS.
    I also have some Unity Assets: assetstore.unity.com/publishe...
    Some links may be affiliate links, which at no additional cost to you, gives me a small portion of the purchase.
    #unitytutorial #tutorialtuesday #gamedev #tutorial #unity #llamacademy #gamedevelopment
    #monetization
    Chapters:
    00:00 Overview
    00:52 Installing Unity IAP
    01:43 Enabling In-App Purchasing in your project
    02:26 Get Google Play Licensing Key
    03:23 Configure IAP Catalog
    07:47 Sales
    08:51 Export to Google Play
    09:49 Coded Unity IAP Initialization
    15:46 Load Icons for each IAP Catalog Items
    18:50 Create UI Items for each IAP Product Catalog Item
    23:05 Purchasing an Item
    25:23 Create an IAP Store Page
    26:54 Demo the IAP Store Page - Some work still required
    27:31 The "Fake Store"
    28:41 IAP Store Page - Exclude "Sale" Items and dynamically size Content Panel
    30:40 Final Demo
    31:09 Set up for the Apple App Store
    33:55 Closing Thoughts and Support LlamAcademy

Комментарии • 172

  • @rexbefall99
    @rexbefall99 8 месяцев назад +21

    This tutorial doesn’t mention for iOS you have to review and agree to the Paid App document in App Store Connect to get IAP to work at all on iOS. I was stuck on “No products available” for a while and on completing the document everything started working. Just an FYI in case anyone is having a similar issue

    • @soumyamohanty7389
      @soumyamohanty7389 6 месяцев назад

      I face same problem can you please tell me how to solve

    • @johndee2091
      @johndee2091 4 месяца назад

      Oh So if I do a testflight and then IAP don't work it's because of the paid tax form ? I tried hundred of thing to no avail. Even submit my game and they refuse it saying the IAP did not work but never said why. IAP work when testing it with my Ipad and xCode storekit but thag's about it.

    • @usernamenotfound3847
      @usernamenotfound3847 4 месяца назад +1

      Yup, you are the absolute best! Best information ever, I stuck on that part for a week and even send a message to Unity forum asking, they tell me to uninstall IAP and stuff, wish I see this comment earlier so I don't have to deal with that stress lol

    • @rexbefall99
      @rexbefall99 4 месяца назад +1

      @@johndee2091yes most likely the tax form if everything else is set up correctly. Double check your implementation and the make sure you’ve completed the forms

    • @johndee2091
      @johndee2091 4 месяца назад +1

      @@rexbefall99 Thank you :)

  • @khosroafshar
    @khosroafshar Месяц назад +1

    Thanks for your Great tutorial!

  • @ooDEFENDERoo
    @ooDEFENDERoo Год назад +2

    Thank you!

  • @oliverbrzoska9055
    @oliverbrzoska9055 10 месяцев назад +7

    Great tutorial, but unfortunately not for subscriptions! They no longer work the same as other In-App Purchases, especially Google changed their system (with multiple 'base plans' and 'offers' per subscription). Unity IAP seems not to work seamlessly with subscriptions. Do you have any advice/link for dealing with subscriptions with Unity in 2023? Or even better: please do a Tutorial for subscriptions with Unity in 2023!

  • @drunk3np1nky40
    @drunk3np1nky40 Год назад +1

    Hello again! May I ask you for an advice? What is the best approach you have used so far for adding different entities to player? For instance, artifact and soft currency are not the same entities, they are different classes, different fields. For artifact it's obvious to set level and rarity, but for soft currency only amount. So, how do you typically handle purchase like at 24:50? Thank you in advance! And thank you very much for your impact in our learning process!

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      I can explain how I implemented this in my game and hopefully it provides some insight into how you can do it for your game.
      I used PlayFab which, upon login, I fetched the details about a player. This included information that you could store locally in a file such as the "inventory", different amounts of each "currency", and their stats.
      In my game I had unlockable items and currency available for purchase.
      When a player makes a purchase, I sent a request to PlayFab to validate a purchase and on the server there, I set "ItemXXX_Unlocked" to be true and sent a success message back to the mobile client.
      For more simple use cases such as only on-device unlocks, you can remove the network and server complexity and just set the boolean to true. Because my game had relatively few unlock items this was simple and worked well. If you have a large number of items, perhaps on each discrete item you would have an "Unlocked" boolean and set that based on the purchase.
      For currency, it is very simple because we just add the amount purchased to the player's "inventory".
      I only had 3 types of purchases, currency, item, or bundle which may include multiple items and/or currency. I implemented a purchase processing strategy based on the item type and either added currency, did the unlock as described above, or for the bundles, parsed the json "additional data" and used one of the other strategies for each element of the bundle.

  • @nadaked
    @nadaked Год назад +1

    thnx a lot!!

  • @kareembutler5916
    @kareembutler5916 Месяц назад

    great tutorial.
    How would i make a restore purchase button? and two only 3 of the 4 products show in the store. I am getting debug alerts stating everything was successfully loaded but only 3 Ui Products are being created

  • @SeverskiyS
    @SeverskiyS 6 месяцев назад

    Hello! Thanks for information! Very helpful video! Can you please answer, why do you load Texture2d from Resources, and noat a Sprite? Is this because optimisations reasons? Or because something else?

    • @LlamAcademy
      @LlamAcademy  6 месяцев назад +1

      I found it easier to put the textures there and create the sprite, but if you load a sprite from the resources folder it should work the same.

  • @flurinjenal374
    @flurinjenal374 10 месяцев назад +2

    How do you implement a subscription-type IAP where the player gets charged monthly? Specifically, how can you check in your game if the player is still subscribed or if he uncubscribed in his phone settings and stop giving him the benefits of the subscription?

  • @user-df6zt6yi9c
    @user-df6zt6yi9c Год назад +1

    the product ui shows up in the editor, but not on the google play export. Any advice?

  • @prudentibus
    @prudentibus 11 месяцев назад +1

    Thx for sharing a project on git

  • @yannmassard3970
    @yannmassard3970 Год назад

    Man, I love the way you code, but coding the Ui to build itself (are you coming from a swift background) was a first time for me ! learned a lot about events and invoke()

    • @LlamAcademy
      @LlamAcademy  Год назад

      I haven’t used Swift. Glad to hear you’re enjoying it though!

  • @erjuanjojj
    @erjuanjojj Год назад +1

    One more question please X)), for purchasing in the real store, we only need to remove the two lines of 27:54??
    or do we have to change something more? Thank you

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      As long as everything else on the store page is set up, all you should do is remove the “fake store” code and, based on the earlier implementation, should go to the correct “real store”

  • @FabrizioCoppolecchia
    @FabrizioCoppolecchia 9 месяцев назад

    Nice video thank you, do you know how to handle new device ? If i change device and log again with same user , how to restore all purchases? Must be saved all on cloud save or the play/app store take care of that? For example if i have the "remove Ads" purchase item and i want to link that purchase to the google accunt.

    • @LlamAcademy
      @LlamAcademy  8 месяцев назад

      Yeah for these you'll need some cloud save for the purchases. Another person was asking similarly for how to handle adding different entities to the player. I handled all this more or less the same way because for my game I used PlayFab so it was the "source of truth" for all player data. Regardless if the player is using 5 devices, any unlocks are stored on their account so they don't have to repurchase it.

  • @LostSol25
    @LostSol25 10 месяцев назад

    Quick question -> how could i have the currency change due to different locations, i have noticed this on most games.

  • @VEETEEGameStudio
    @VEETEEGameStudio 11 месяцев назад

    i get null refrences when i try to access the payout quantity on the ProcessPurchase Function when im trying to handle giving the player the product

  • @cristiansmochina9056
    @cristiansmochina9056 3 месяца назад

    What should I do if I already have the catalog setup in Apple? How can I import it in Unity?

  • @lemangkuk
    @lemangkuk 8 месяцев назад +1

    I have a question, for example, If I make a purchase button for remove ads, or unlock more content, how does the state save for removing ads and unlocking more content? for example if user made the purchase and they uninstall the app from the phone and install back again, will the remove ads or, unlock more content considered purchase by the user and they don't have to buy again?

    • @LlamAcademy
      @LlamAcademy  8 месяцев назад

      That is a good (and common) question. For persisting purchases you'll need some way to save it on the cloud. Apple and Google both (at least they used to) provide a small amount of cloud storage for your app for free. In there you could store small amounts of data such as "unlocked ad free" and pull that on app launch.
      In my game I had all the purchases synchronized to PlayFab, so whenever the user logged in, I pulled the data off PlayFab and knew their loadout, purchases, etc...
      For simpler use cases I think the Apple/Google services can suffice.

  • @erjuanjojj
    @erjuanjojj Год назад +1

    If I have a non consumable item like "remove ads", how can I manage that, once someone purchases it, set some variable inside the software to handle showing or not showing ads? thank you

    • @LlamAcademy
      @LlamAcademy  Год назад

      I think you explained it perfectly 🙂. You check the product that was purchased, for this particular one, you set some boolean like hasPurchasedAds and persist that somewhere, such as the save file for the player, a cloud storage location, or even simply in PlayerPrefs (for initial testing at least).

    • @erjuanjojj
      @erjuanjojj Год назад +1

      @@LlamAcademy Hmmm, I think you can simply, in any place of your code, do a for loop in the catalog products and check the field "hasReceipt" of each one. That way you are always checking which items have receipt or not. I'm not 100% sure but I thinsk so.

  • @flurinjenal374
    @flurinjenal374 Год назад +6

    At 3:00, error: "You are not authorized to set the key." - There is no Legacy Analytics to toggle on an off. What helped for me: Insert the key in the Unity dashboard (as shown in the video in the previous step), restart Unity and logout as Unity user and login again. It took some minutes after it but then the error went away.

    • @monkegames6133
      @monkegames6133 Год назад

      I LOVE YOU MAN! I did it but then I waited like an idiot for the error to go away so I wanna add that after doing everything you said, you need to insert the key again and then press "verify". I looked like that shocked O.O anime meme guy when it ended up working

    • @flurinjenal374
      @flurinjenal374 Год назад

      Great that it worked for you too! Yes, you have to click the button again.

    • @abdulhaseebkhan1177
      @abdulhaseebkhan1177 Год назад +1

      sir i logOut User , restart unity, login Again, did some wait , but still i face this issue that you are not authorized to set licency key

    • @monkegames6133
      @monkegames6133 Год назад +1

      @@abdulhaseebkhan1177 Did you get the app key on Google play and insert it in the Unity dashboard first?

    • @abdulhaseebkhan1177
      @abdulhaseebkhan1177 Год назад

      @@monkegames6133 yes i did.

  • @spectrumRoyale
    @spectrumRoyale Год назад +3

    I think the main problem against this method is that you can't set global price which when you are using automatic unity purchasing(recommended) it setup for you automatically for all regions. Let's say initial price is 5EUR in many other countries it should be different.

    • @LostSol25
      @LostSol25 10 месяцев назад +1

      Did you find a way, struggling with that now

  • @lalalala99661
    @lalalala99661 Год назад

    In the Project Settings the update is saying you are not authorized will send an e-mail from unity to tell you Legacy Analytic is no longer working. instead it tells you to install the UGS Analytics SDK.

  • @newsystem3667
    @newsystem3667 3 месяца назад

    I would like to see subscription product implementation

  • @seanlynch4354
    @seanlynch4354 19 дней назад

    when I click buy on my iPhone it doesn't open the typical apple wallet and allow Face ID to let me pay. Instead I just get a little prompt that asks me to type in my appleID email and password. Other games have the wallet appear with all the product information displayed in a nice interface. How can I get my in app purchases to look like this?

  • @erjuanjojj
    @erjuanjojj Год назад

    Do you know if this can be managed via IronSource API? I have ads managed with it and would be nice if you can also manage In App Purchases

    • @LlamAcademy
      @LlamAcademy  Год назад

      Sorry, I don't have any experience with IronSource to be able to answer this. I set up UnityAds a few years ago but it may be different now that IronSource is in the mix

  • @Kanookoochn
    @Kanookoochn Год назад +1

    hi did you know how to make server side checking when purchase complete?

    • @LlamAcademy
      @LlamAcademy  Год назад

      I haven't specifically looked into that, but my understanding is you have your own server and call the google play or app store API with the token received on purchase complete.

  • @maxg5196
    @maxg5196 Год назад +1

    Great video. I have recently been thinking about adding cosmetic purchases to the game I am making. My game will be a browser game, played through the WebGL export however. What would be the differences between what you showed here and creating IAP purchases for WebGL? Or would you need to use a different system then Unity IAP entirely?

    • @LlamAcademy
      @LlamAcademy  Год назад

      For WebGL, I think you can do the same process here, but you’d have to implement a custom store like they define here: docs.unity3d.com/Manual/UnityIAPImplementingAStore.html
      Which is totally doable, but it becomes fully your responsibility to do the integration with Shopify or whatever store you’re trying to use on WebGL.

  • @Hi_Names_Nat
    @Hi_Names_Nat 9 месяцев назад

    I followed this guide but the payout is always null when I get the catalog item. Is this an issue with not having the Google Play key inside of Unity Dash yet?

    • @LlamAcademy
      @LlamAcademy  9 месяцев назад

      If you are reading the IAP Catalog the payouts should always be present because it's there in the Product Catalog JSON file. Can you double check your code and configuration? Or maybe share your code?

    • @Hi_Names_Nat
      @Hi_Names_Nat 9 месяцев назад

      ​@@LlamAcademy Still having this issue. I've realized my problem is in the builder, and it doesn't actually grab the payout there either. I've checked everything over quite a few times, so i'm pretty sure my code is fine, but ill share it if i really need to. My only thing i think it could be is the google play key, for whatever reason I can't add it, is that *required*? I wouldn't think so.

  • @r.allenposchii9082
    @r.allenposchii9082 Год назад

    Hello, I am trying to figure out how to check if an item is consumable or none consumable this I don't think you covered that yet could you help me out on this pleases.

    • @LlamAcademy
      @LlamAcademy  Год назад

      Hi! On the product, you specify if it is consumable or not. When processing the purchase it tells you which specific product was purchased along with the attributes, so you can find based on the product if it is consumable or not

  • @brunozelic6576
    @brunozelic6576 Год назад

    Is there a way to verify the purchase on my own server? Im using my own server databases to store item data so I want to avoid any potential cheating on the client side. Maybe some kind of reciept that verifies a transaction has been made?

    • @LlamAcademy
      @LlamAcademy  Год назад

      Google and Apple both have server side receipt validation: docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html
      You can implement your own receipt validator to do whatever you need to on your side. When I implemented this, I did not do server validation, but you can wait for the validation to apply whatever changes should be there for the purchase

    • @brunozelic6576
      @brunozelic6576 Год назад

      @@LlamAcademy Thanks, Solved it with googles verification api for python. Although it was waay too complicated to setup. Too many steps and no solid info anywhere. Seems like a good idea for a future tutorial if you need one! :)

  • @neilfosteronly
    @neilfosteronly Год назад

    At 15:22 using a capital E "ExtensionProvider" created an error at 15:32. I used "private IExtensionProvider extensionProvider;" instead.

  • @GameTechnich
    @GameTechnich Год назад

    Hi i searched whole internet and cant find info, i have IAP integrated in Unity game that works fine on Google Play and AppStore but now i need it to work for Windows Store, what to do after switch to UWP for Windows Store, is there any changes to make in Codeless script except ID of iap item?? Any advice? Tnx

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      It should just be the ID and following the same kind of process to configure the UWP IAP items on their store. I haven't released on UWP/Windows Store so unfortunately I don't have any guidance on that side of things.

    • @GameTechnich
      @GameTechnich Год назад

      @@LlamAcademy thanks, i will try then.

  • @youHaveNoEnemies214
    @youHaveNoEnemies214 Год назад +1

    Hi I'm currently following your tutorial and I'm in the Export To Google Play section, but on the Google Play Console it doesn't have export option. Instead there was this Message saying "Your app doesn't have any in-app products yet
    To add in-app products, you need to add the BILLING permission to your APK"

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      That usually means the version of your app that you uploaded did not include IAP. First build your game and upload it with Unity IAP in the game with no products, then it should start working for you.

    • @youHaveNoEnemies214
      @youHaveNoEnemies214 Год назад

      @@LlamAcademy thank you very much for the quick reply, I'll look into it

    • @youHaveNoEnemies214
      @youHaveNoEnemies214 Год назад +1

      @@LlamAcademy Thanks bro! that solved my issue.

  • @adslpiulentoditalia2545
    @adslpiulentoditalia2545 Год назад

    Is there a way to assign directly a SetupModel quantity to give goods after we succed to buy currency

    • @LlamAcademy
      @LlamAcademy  Год назад

      I set up “bundles” as items that granted currency and items. In the “data” field where you can specify arbitrary data, I put JSON for how much currency, and which items should be unlocked. Then when processing bundles, I would parse that data and add currency or unlock items.

    • @adslpiulentoditalia2545
      @adslpiulentoditalia2545 Год назад

      @@LlamAcademy why make this such overcomplicated? Can't I just providing it directly into OnPurchaseProcessing ()? Like using switch statement?

  • @light-light
    @light-light 3 месяца назад

    I met failure says store initialize failed, I checked both at true (auto initialize) at unity catalog. Is it reason?

  • @lucyp4339
    @lucyp4339 25 дней назад

    In the HandleLoadIcon(AsyncOperation operation) function, the request = operation as ResourceRequest is always returning null and therefore not completing the rest of the shop setup. I've copied and pasted the code from github in case I typed it in incorrectly. Any help from anyone please T-T

  • @t-games7419
    @t-games7419 Год назад +1

    I am still unable to verify options in In-App Purchasing .Even I On and Off the Legacy Analytics😟😟😟

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      What do you mean by verify options? You get an error when initializing?

  • @Yesishootmodels
    @Yesishootmodels 10 месяцев назад

    how can i do a subscription iap for my unity game i need help!!!!!

  • @LostSol25
    @LostSol25 10 месяцев назад

    Do they code the Ui in professional environments, this is a new thing for me haha nice tutorial!

    • @LlamAcademy
      @LlamAcademy  10 месяцев назад

      When you need Dynamic UIs, sometimes it just makes sense 🙂

  • @usernamenotfound3847
    @usernamenotfound3847 4 месяца назад

    not sure if I did something wrong, but for those making builds for IOS and google, remember to handle the fakestore, might need to do a #if to check if it's running in editor or development build, otherwise the fakestore will get carry over to real builds you uploaded.

  • @WebBusiness
    @WebBusiness Год назад

    i get the price in my local currency 4.99 INR in google play console how to set it global

  • @jerecodelacruz9252
    @jerecodelacruz9252 Год назад

    Is there any option to lower down the minimum android API requirements in the play store?

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      You can have a lower minimum version, but the target must be the latest one Google requires. These two drop downs do not have to be the same number.

  • @Danny1y5
    @Danny1y5 Год назад +1

    When uploading google play csv I get an error "Missing the listing for the default language"

    • @recriandogames
      @recriandogames 11 месяцев назад

      Me too

    • @noaxenclips
      @noaxenclips 10 месяцев назад

      You need to ad a translation in your default Language

  • @jhgfghjfuzrtfchchghgf
    @jhgfghjfuzrtfchchghgf Год назад

    When I try to upload the csv to Google Play, I get the error: Row 2: Missing the listing for the default language.
    It shows that for every row. the selected language in unity is the default: English (US). Do you know how to fix that?

    • @LlamAcademy
      @LlamAcademy  Год назад

      Strange one. Can you try to update the value of the dropdown to something other than english, then change it back to see if it resolves it?

    • @Danny1y5
      @Danny1y5 Год назад

      Having the same problem. Did you find a fix?

    • @recriandogames
      @recriandogames 11 месяцев назад

      Same problem here

    • @LostSol25
      @LostSol25 10 месяцев назад

      Had the same problem

    • @noaxenclips
      @noaxenclips 10 месяцев назад

      You need to ad a translation in your default Language

  • @GameDeveloperTR
    @GameDeveloperTR Год назад

    Hello. I applied the tutorial to my own project. The internal test version does not make a real purchase. It opens the fake store just like in the editor. How can I make a real purchase?

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      You will need to disable/undo the fake store code we put in late in the video and initialize it with the real store. We initialized with a fake store just for the demo.

    • @GameDeveloperTR
      @GameDeveloperTR Год назад +1

      @@LlamAcademy Thank you. You've been very helpful. respect

  • @andrelittle1230
    @andrelittle1230 Год назад +1

    Hey Chris great video as usual. I was wondering can you do a video on how to setup azure for git inside of vs and an example of pushing code and assets from unity. Thanks in advance

    • @LlamAcademy
      @LlamAcademy  Год назад

      Hey! Have you see this video?
      ruclips.net/video/vq5zuXBzlW8/видео.html I cover much of how to set up a git project on both Azure DevOps and GitHub and how I handle pushing code for solo projects in most cases.

  • @WebBusiness
    @WebBusiness Год назад

    how to use with pricing template

  • @GameDeveloperTR
    @GameDeveloperTR 10 месяцев назад

    Placeholders (sold items) do not come on iphone. what could be the reason for this?

    • @LlamAcademy
      @LlamAcademy  9 месяцев назад

      I'm not sure I understand this question. You mean you can't view already purchased items?

    • @GameDeveloperTR
      @GameDeveloperTR 9 месяцев назад

      @@LlamAcademy While iap store is displayed properly on android devices, items sale are not displayed/loaded on IOS devices.

    • @LlamAcademy
      @LlamAcademy  9 месяцев назад

      ​@@GameDeveloperTRDo you get any error or does it just give you an empty page? I had some errors when I didn't have the App Store version available on TestFlight yet.

  • @johndee2091
    @johndee2091 3 месяца назад

    Does the tutorial provide receipt validation ?

    • @LlamAcademy
      @LlamAcademy  3 месяца назад

      I briefly mention what you need from the Unity IAP package to do it, but I do not cover exactly how to handle receipt validation in this video.

  • @drunk3np1nky40
    @drunk3np1nky40 Год назад

    For Whatever reason I get error "Purchase not correctly processed for product "myProductName". Add an active IAPButton to process this purchase, or add an IAPListener to receive any unhandled purchase events."
    I have "Initialize Unity.Purchasing automatically" unticked. And I don't have any IAPButtons or IAPListeners in my scene, cause mixing Codeless IAP and Coded one is strictly not advised. But it only works with "Initialize Unity.Purchasing automatically" ticked and actually refers to my IStoreListener (But UnityPurchasing.Initialize() does the same thing). My custom buttons use the same editor functionality as IAPButton has (not to input string manually but to choose id from catalog directly). But I don't believe this is the case. Has anyone faced the same kind of problem? Anyway thank you very much! It's a great introduction to Coded IAP.

    • @drunk3np1nky40
      @drunk3np1nky40 Год назад +1

      Well, the answer is obvious. The order is important. You have to wait until unity services initialize before calling UnityPurchasing.Initialize() 😁

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      😁 glad you figured it out, and thank you for sharing the answer as well!

  • @GameDeveloperTR
    @GameDeveloperTR Год назад

    I get an "StoreIconProvider has already been initialized!" error when I reset the scene. can ı help you?

    • @EdgarRdzG09
      @EdgarRdzG09 Год назад +2

      I don't know if you already solved it, but the error is in that the dictionary is not created well, what you can do is to initialize it at the moment of entering to the Initialiaze method, it would be something like this:
      public static Dictionary Icons { get; private set; }
      public static void Initialize(ProductCollection products)
      {
      Icons = new Dictionary();
      if (Icons.Count == 0)
      {
      Debug.Log($"Loading store icon for {products.all.Length} products.");
      TargeticonCount = products.all.Length;
      foreach (Product product in products.all).
      {
      Debug.Log($"Loading store icon in path StoreIcons/{product.definition.id}");
      ResourceRequest operation = Resources.LoadAsync($"StoreIcons/{product.definition.id}");
      operation.completed += HandleLoadIcon;
      }
      }
      else
      {
      Debug.LogError("StoreIconProvider has already been initialized!");
      }
      }

    • @usernamenotfound3847
      @usernamenotfound3847 4 месяца назад

      You are a life saver!@@EdgarRdzG09

    • @usernamenotfound3847
      @usernamenotfound3847 4 месяца назад +1

      also, not sure if this happened to you, after fixing the dictionary, I ran into the error: MissingReferenceException: The object of type 'DemoStorePage' has been destroyed but you are still trying to access it.
      What I did is add a function of OnDestroy:
      void OnDestroy() {
      StoreIconProvider.OnLoadComplete -= HandleAllIconsLoaded;

      }
      this solve my problem, hope this is helpful😃

  • @ozgungor2339
    @ozgungor2339 11 месяцев назад

    𝗡𝗲𝗲𝗱 𝗛𝗲𝗹𝗽
    I pasted the id from the google play store but it gave an error "You are not authorized to set the license key" and then I go to the Legacy Analytics to make it work. But however I don't have Legacy Analytics in the sections or services. I tried to download it from the Package Manager but it was not there. I need help.

  • @parhamrezaee6996
    @parhamrezaee6996 11 месяцев назад

    Iap button(lagacy) has been deprecated pls use codelss iap button instead, i keep getting this error, pls make a video on unity iap 4.93 and new iap button

    • @LlamAcademy
      @LlamAcademy  11 месяцев назад

      I checked out the documentation, there is very little difference between the two. Did you try using the other button?

  • @light-light
    @light-light 3 месяца назад

    Payouts are essentials? Just leave it blank and manually give item from code?

  • @neilfosteronly
    @neilfosteronly Год назад +1

    I got everything working but still a bit confused on how the PurchaseProcessingResult works. I followed your "Learn how to persist data in your game" tutorial.
    If the user goes on a new device how would they reload what they have bought? Any docs on this as my searches are pulling up nothing. Is there some built in way for android and apple to reload the data from last device played?
    Also your link for "Learn how to persist data in your game" is not working.
    Thanks for the videos. Last two weeks keeping getting your videos shown when looking for solutions.

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      Hey 👋 For persisting data across devices you'd need some system to "back up" what the user has purchased. In my game I was using PlayFab as the backend that, if you purchased anything, it was automatically persisted because I stored the user's "inventory" on PlayFab and all purchases were to grant currency or unlock items.
      Depending on your game, you could use a similar process, or even just persist a data file on the Google or Apple services so they're tied to the user's account. Once the user logs in you could pull that data and automatically they would get the majority of purchases back.

    • @helloyou191
      @helloyou191 11 месяцев назад +1

      @@LlamAcademy hey, could you please elaborate the process on " persist a data file on the Google or Apple services so they're tied to the user's account" ? How's this service called, so I can gather more information about this on the internet?

    • @LlamAcademy
      @LlamAcademy  10 месяцев назад +2

      Sorry for the delay here. Google Play Services and Apple Game Center. You have to opt-in to those and do some set up which you can see on the Google Play Console / App Store Connect. Each comes with their own SDK and you can choose which features to use and enable.

  • @barbariankinggamer3366
    @barbariankinggamer3366 Год назад +1

    I still get the error "You are not authorized to set the license key" even after i toggle Legacy Analytics On/Off and i have already set it in the dashboard. Any help?

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      Make sure now that both Legacy Analytics and IAP are turned ON and try to restart the editor to see if that helps

    • @barbariankinggamer3366
      @barbariankinggamer3366 Год назад

      @@LlamAcademy i get an email that Legacy Analytics is no longer in use every time i try to turn it on. But ill try that and see how it goes

    • @barbariankinggamer3366
      @barbariankinggamer3366 Год назад

      @@LlamAcademy I restarted the project and the Lecagy Analytics window is gone and am still getting the error. Any advice?

    • @LlamAcademy
      @LlamAcademy  Год назад

      Which version of Unity are you using 2021?

    • @barbariankinggamer3366
      @barbariankinggamer3366 Год назад

      @@LlamAcademy 2021.3.6f1

  • @dedz
    @dedz Год назад

    its saying that I need to add permission for BILLING in the SDK when trying to upload the csv file into google play store

    • @dedz
      @dedz Год назад +1

      Just got it! You need to upload a version with the new In app purchase package. If he said that, I am sorry

    • @LlamAcademy
      @LlamAcademy  Год назад

      glad you got it working!

  • @juanlamanna2915
    @juanlamanna2915 Год назад +3

    wow muchas gracias no entendía para nada la funcionalidad de estos scripts hasta que vi tu video,
    por cierto para no escribir solo descargue los tuyos y los edite

    • @worchockyt
      @worchockyt 11 месяцев назад

      Hola, amigo te ha funcionado el código correctamente? es decir ya lo probaste?

  • @HikikomoriDev
    @HikikomoriDev 11 месяцев назад +1

    What if I wanted to implement crypto payments in-app?

    • @LlamAcademy
      @LlamAcademy  11 месяцев назад

      That would be a totally separate system to support payments then. Unity IAP supports interfacing with a Store, but the Store is the one that actually processes the payments.

  • @yale3d
    @yale3d 3 месяца назад +1

    It works only with USD. If i give the price in the IAP Catalog in USD (I cannot set the currency anywhere, and it is always USD), the price on Google Play Store is wrong. If i give the price in my local currency (which is default by google, so i cannot change it), it shows an alarmingly large amount of USD in the App. Mildly infuriating.

  • @svenwork3511
    @svenwork3511 5 месяцев назад

    can this work on steam as well?

    • @LlamAcademy
      @LlamAcademy  5 месяцев назад +1

      I think for it to also work with Steam you would need to custom implement the Steam Store. Unity has provided implementations for App Store & Google Play Store but Steam is not supported out of the box.

  • @user-df6zt6yi9c
    @user-df6zt6yi9c Год назад

    how do i update the IAPProductcatalog.json file?

    • @LlamAcademy
      @LlamAcademy  11 месяцев назад

      This is generated by making changes in the inspector like we did early in the video.

  • @tunahancoskun3375
    @tunahancoskun3375 Год назад +1

    Hello , Is this how it is done for Photon?

    • @LlamAcademy
      @LlamAcademy  Год назад

      I don't think Photon and IAP have much to do with one another. Maybe you would do server-side validation of an IAP receipt and validate it. I did not cover that piece here, but you can read more about the receipt validation here: docs.unity3d.com/Manual/UnityIAPValidatingReceipts.html

    • @tunahancoskun3375
      @tunahancoskun3375 Год назад

      @@LlamAcademy So can you make a video about it? Difficult to find help online

  • @VEETEEGameStudio
    @VEETEEGameStudio 11 месяцев назад +1

    it keeps saying i amnot authorize to set the liscense key, and ive tried everything

    • @LostSol25
      @LostSol25 10 месяцев назад +1

      Same, did you fix it?

    • @VEETEEGameStudio
      @VEETEEGameStudio 10 месяцев назад

      @@LostSol25 nah ... I guess it's a bug because it doesn't affect the build whatsoever the IAP still works fine

  • @rajsah4667
    @rajsah4667 3 месяца назад

    Does this work for webgl?

    • @LlamAcademy
      @LlamAcademy  3 месяца назад

      I believe For WebGL you will have to implement your own store (can’t use the Unity-provided Store implementation for google play / App Store since you’re not on that store). This concept can still be used but there is more work involved

  • @duylongchau8042
    @duylongchau8042 Месяц назад

    I wish Apple supports the IAP xml. For small game it's ok to use AppStore but for big game setup 50-100 products at a time is driving me mad.

    • @LlamAcademy
      @LlamAcademy  Месяц назад

      Me too :( very sad they stopped having an upload mechanism.

  • @doctordiv
    @doctordiv 4 месяца назад +1

    FYI - You can not import unless your APK already has IAP implemented. 9:10

  • @sahilshaikh3454
    @sahilshaikh3454 Год назад

    getting error you are not verified to verfy key

  • @DanielWicht
    @DanielWicht Год назад

    Thanks a 1000 times for this great video! After adapting the code to my needs I had the problem that "private void HandlePurchaseComplete()" was never called. I guess I did sth wrong but maybe you want to double check if it really works as intended.

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      Hey! I'm glad you found it helpful. I did test this with a fully deployed test app and my own mobile game is even using this same paradigm. It is hard to say exactly what may be wrong, but you can always compare what you have against what's in the GitHub repository to see if there was something small missing!

  • @lorenzoluis6440
    @lorenzoluis6440 11 месяцев назад

    Olá, quero rodar um joguinho quem fica responsável pelos pagamento aos jogadores? Sou eu ou o Unity?

    • @LlamAcademy
      @LlamAcademy  11 месяцев назад

      You are responsible to pay users out if you want to give them real currency. Even with Unity IAP, Unity does not collect the money. They're just providing a layer of abstraction over each of the stores that actually handles the purchasing and billing.

  • @INeatFreak
    @INeatFreak Год назад +3

    I hyperventilate every time see someone using PascalCase for the variable names

    • @INeatFreak
      @INeatFreak Год назад

      use camelCase or snake_case or anything but that. It's so easy to confuse a variable with a class/struct type that way.

    • @LlamAcademy
      @LlamAcademy  Год назад +1

      👀🙃

  • @laniakeadev.2271
    @laniakeadev.2271 10 месяцев назад

    Does not work on mobile. Stucks on " UnityPurchasing.Initialize(this, builder);"

    • @LlamAcademy
      @LlamAcademy  9 месяцев назад

      What error do you get?

    • @laniakeadev.2271
      @laniakeadev.2271 9 месяцев назад

      @@LlamAcademy np errors. Fixed by moving next operators to OnInitialized and enabling auto-initialization

    • @LlamAcademy
      @LlamAcademy  9 месяцев назад

      @@laniakeadev.2271 oh, great! I'm glad you got it working!