GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Armelline's In-App Purchase Tutorial Template

13

Comments

  • HymloeHymloe Posts: 1,651Member

    With Restore Purchases, is the expectation simply to restore any non-consumable IAPs, and any consumable purchases that they've made are lost if they have uninstalled the app, for example?

    Also, once you restore purchases, what does the resulting Purchase Data look like? Would the Status cell of a non-consumable IAP say "Purchased"?

    Like, if you had 5 different non-consumable IAPs, and the player had bought 3 of them, then deleted the game, then re-installed it, then hit Restore, what would the table look like once it had been successfully filled?

    Would it say "Purchased" in the Status cell of the 3 items they had bought?

    And would the developer therefore check each Status cell, and update their in-game attributes to reflect those, and then save them?

  • ArmellineArmelline Posts: 4,724Member, PRO

    With Restore Purchases, is the expectation simply to restore any non-consumable IAPs, and any consumable purchases that they've made are lost if they have uninstalled the app, for example?

    Yes. Apple are getting increasingly fussy about consumable purchases, though. If you purchase coins and then buy non-consumable things with them, Apple expect the player to be able to restore those things.

    Also, once you restore purchases, what does the resulting Purchase Data look like? Would the Status cell of a non-consumable IAP say "Purchased"?

    purchased/unpurchased.

    Like, if you had 5 different non-consumable IAPs, and the player had bought 3 of them, then deleted the game, then re-installed it, then hit Restore, what would the table look like once it had been successfully filled?

    purchased/purchased/purchased/unpurchased/unpurchased

    And would the developer therefore check each Status cell, and update their in-game attributes to reflect those, and then save them?

    Pretty much, yes.

  • HymloeHymloe Posts: 1,651Member

    Great!

    Makes sense, I'll give it a go. :)

  • neomanneoman Posts: 813Member
    edited April 2017

    Hey Armelline! I must thank you again for this. It made life a lot easier implementing the new IAP system for both consumables and non-consumables. Thank you for spending the time nutting and testing how it all works. You saved me a lot of time and effort. I really appreciate what you have done for the community ... :smile:

  • ArmellineArmelline Posts: 4,724Member, PRO

    @neoman said:
    Hey Armelline! I must thank you again for this. It made life a lot easier implementing the new IAP system for both consumables and non-consumables. Thank you for spending the time nutting and testing how it all works. You saved me a lot of time and effort. I really appreciate what you have done for the community ... :smile:

    Thanks for the kind words! I'm really glad it was helpful!

    When I eventually get time, I shall update it with a few little improvements and a better guide for consumables!

  • CasualEvolutionCasualEvolution Posts: 412Member, PRO

    Hi @Armelline thanks for this tuto!
    I have a couple of questions:

    • there is some way to show the iap price (col 4) in a button? previous to request purchase data? I want to show the price, but i would like avoid to have the request login from store.

    if no way...

    • it is mandatory from Apple show the price of the iap before pressing the button? I prefer that, to avoid login previous to action of buy

    In general games show the prices of their stores without having a login in Apple, how they do that?

    Thank you

  • ArmellineArmelline Posts: 4,724Member, PRO

    there is some way to show the iap price (col 4) in a button? previous to request purchase data? I want to show the price, but i would like avoid to have the request login from store.

    A lot of developers opt to show the price in USD, in which case you can just put the price for each item in a table and refer to that. Unfortunately there's no way to get the local prices from Apple, however, without at least one IAP request data from the store, which as you note can trigger a login request.

    Last I checked it wasn't mandatory to show a price, as the initial buy popup from Apple shows the price, but users are more likely to buy something when they know how much it costs in advance. A lot of people live by the mantra "if you have to ask how much it costs, you can't afford it".

    Games that show prices will either store them locally, or use slightly more efficient IAP code than GameSalad provides. I used to be strongly in favour of not risking that confusing login appear, but it seems to be less likely in the last few iOS versions, so I'd not worry too much about it now. Very few users are logged out sufficiently for the popup to appear these days.

  • CasualEvolutionCasualEvolution Posts: 412Member, PRO

    @Armelline thanks for the quick response! :)
    Now I need think a little to choose the road to take... as in life itself! :P

  • ButlerProductionsButlerProductions Posts: 1Member, PRO

    Been having an issue where buy item will not change PurchaseTable to pending.

  • ArmellineArmelline Posts: 4,724Member, PRO

    @ButlerProductions With the template, or your implementation of it?

  • It gives me an error showing with screenshot with your in app purchase template. I even tested it out but it gives me this error.

  • ArmellineArmelline Posts: 4,724Member, PRO
    edited September 2018

    @Titanical Tech Production said:
    It gives me an error showing with screenshot with your in app purchase template. I even tested it out but it gives me this error.

    Not sure what error it's giving you. Nothing in your screenshot looks unexpected. Did you carefully read the notes inside the template?

    The template has been confirmed as still working as recently as 2 weeks ago.

    It's extremely hard to accurately test IAP in the Creator, though. It will not give you a representative look at how things work. You need to compile an actual game build and send it to TestFlight or set up a testing account on your device to get a real feel of if things are working.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

    @Armelline Love This! One question how would setup a free trial and then after 7 days charge the customer. The user gets to access the entire game for 7 days then charge the customer

  • ArmellineArmelline Posts: 4,724Member, PRO

    This could be done by checking the date when the game is first launched, then checking it again each time the app is launched and locking it after 7 days. You'd probably also need to check the date against a server to prevent users changing their system clock. It's possible but not entirely simple.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

    Thanks @Armelline Last question... Im trying to destroy an image once it is purchased but it will not work. Can you check my code for me?


  • ArmellineArmelline Posts: 4,724Member, PRO

    Is game.GameADs changing to 1? I'd also not recommend using a timer to repeated save a table like that.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

    @Armelline yes its changing to one, but the buy button is not destroying

  • ArmellineArmelline Posts: 4,724Member, PRO

    That rule isn't inside any other rule? It's hard to see in the screen shots.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

    @Armelline its in the rule if its purchased

  • ArmellineArmelline Posts: 4,724Member, PRO

    Try taking it out. The attribute is only changed to 1 if the purchase happens, so it doesn't need to be in another rule.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

  • ArmellineArmelline Posts: 4,724Member, PRO

    Think we're already talking at cross purposes. Do you have Skype?

  • kdhjr23kdhjr23 Posts: 29Member, PRO
  • ArmellineArmelline Posts: 4,724Member, PRO

    I really need to see everything, in order. If you can send me a project file to look at or if we can look at it over Skype this will be much easier. I don't even have a clear idea of the order things are happening in, or what rules are inside other rules.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

    At the moment im not in a place to skype

  • ArmellineArmelline Posts: 4,724Member, PRO

    @kdhjr23 said:
    At the moment im not in a place to skype

    Can you send me a project file?

  • ArmellineArmelline Posts: 4,724Member, PRO

    Otherwise the only thing I can really suggest is to put the destroy in an "after 0.05s" timer with run to completion checked. See if that works.

  • kdhjr23kdhjr23 Posts: 29Member, PRO

    @Armelline how can i send it?

  • ArmellineArmelline Posts: 4,724Member, PRO

    @khdjr23 You should be able to drop it in a PM to me.

  • Sheba's JewelsSheba's Jewels Posts: 9Member, PRO

    What would be the best way to put a parental gate into this template?

    I tried adding a scene with a challenge question when the in app purchase is touched, but for some reason it will not change to that scene.

Sign In or Register to comment.