IAP consumable

trying to get a consumable IAP working, i used the standard purchasable…. when i type in self.Callback, this is not saved….
when i load up the project self.Callback is deleted….
when testing Ad Hoc,upon the game starts i am prompted itunes login.. if i cancel it says: purchase was not succesfull…. and the purchase button doesn't respond at all… why does apple have to change this…. it used to be so easy…. kudos to the one that can fix this! (sorry for making a new discussion, probably somewhere there are more topics about it but im not sure where/how to place it)

«1

Comments

  • rvantilborgrvantilborg Member, PRO Posts: 185

    corrected: tablecell value.game.PurchaseTable,1,5 still makes no difference

  • rvantilborgrvantilborg Member, PRO Posts: 185

  • rvantilborgrvantilborg Member, PRO Posts: 185

    figured i needed to create an attribute called 'Callback'…. this was not explained in any tutorial…. now the purchase button is responding, but upon game starts its still prompting the itunes login immediately…. sigh...

  • rvantilborgrvantilborg Member, PRO Posts: 185

    when trying to purchase again, it say's this purchase has already been made,….

  • rvantilborgrvantilborg Member, PRO Posts: 185

    here is a video of whats happening now….
    the game keeps asking to login itunes, also upon closing and re-opening.
    when attempting to purchase again, it say's 'purchase already done… (the language is dutch)

  • rvantilborgrvantilborg Member, PRO Posts: 185

    do i need to put the 'request purchase data' behavior somewhere in between the rules??

  • rvantilborgrvantilborg Member, PRO Posts: 185

    after some adjustments now it looks like this:

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Would make it so it only triggers when you start the purchase process.

  • rvantilborgrvantilborg Member, PRO Posts: 185

    how?

  • rvantilborgrvantilborg Member, PRO Posts: 185

    to be clear, there are 2 problems:

    1. when game starts, it is asking to login to itunes. (if cancelled it says purchase failed)
      2.when buying IAP it displays: item has already been bought.. (it is a consumable)
  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited August 2015

    Instead of saving the purchasetable, you should be saving the game.pink diamonds attribute.
    You never need to save the purchasetable.

    Everything else seems to be correct.

    Mental Donkey Games
    Website - Facebook - Twitter

  • rvantilborgrvantilborg Member, PRO Posts: 185

    didnt help at all, i tried both methods now...

  • rvantilborgrvantilborg Member, PRO Posts: 185

    -still unable to buy my consumable a 2nd time…(item already bought)
    -on game startup, immediately asking for itunes login.

  • rvantilborgrvantilborg Member, PRO Posts: 185


    please also check the youtube clip above that shows whats happening...

  • ArmellineArmelline Member, PRO Posts: 5,364

    Okay, points to consider:

    1. Your "Request purchase data" is not contingent on anything - so it will happen every time you enter the scene with that actor on it.
    2. You don't check if the purchase data was successfully filled. Your "Buy item" is just contingent on you pressing the button.
    3. "Touch is inside" is almost certainly redundant when used with "Touch is pressed".
    4. I'd recommend putting Save Table before Consume Item.
    5. self.Callback is not being saved anywhere, so naturally it will be 0 again when you reload the game. It shouldn't be saved anywhere. Every time you load the game you need to request purchase data before you can do any purchasing.
    6. Use an After timer not an Every time. I'm really not sure why GS say to use an every timer.

    There's probably other things going wrong too. I can't see why it would be trying to make a purchase every time you load the game. It makes sense that it tries to request purchase data, which can cause a login to pop up, but I can't see why it would be trying to make a purchase. It sounds like the consume isn't being triggered properly, perhaps.

  • rvantilborgrvantilborg Member, PRO Posts: 185

    contingent??? whut?

  • rvantilborgrvantilborg Member, PRO Posts: 185

    'you don't check if the purchase data was successfully filled' how should i do that???

  • rvantilborgrvantilborg Member, PRO Posts: 185

    the horror…..

  • ArmellineArmelline Member, PRO Posts: 5,364
    1. Your "Request purchase data" is not contingent on anything - so it will happen every time you enter the scene with that actor on it.

    Every time your scene loads, you'll request purchase data. By "contingent" I mean "no condition needs to be met before it happens". My preference is for purchase data to only be requested when the user tries to make a purchase, but there are circumstances where you need to do it differently.

    1. You don't check if the purchase data was successfully filled. Your "Buy item" is just contingent on you pressing the button.

    It's recommended that you don't attempt to use "Buy Item" unless the callback attribute is set to 1. If you haven't successfully filled the purchase table using "Request Purchase Data", the user can't buy anything anyway.

    You'll do this buy putting an extra condition in that says "If callback = 1".

    I'd recommend you download and carefully read through my IAP tutorial template. It's focused on non-consumable purchases, and has a lot more functionality than you seem to want, but I try to explain the main principles involved in some detail.

    http://gshelper.com/shop/free-templates-and-tutorials/armellines-in-app-purchase-tutorial-template/

  • rvantilborgrvantilborg Member, PRO Posts: 185

    i have completely emptied the IAP from the game… now when starting, it is still asking for my itunes login… could it have something todo with iAds?

  • Agent ArgyleAgent Argyle Member, PRO Posts: 188

    The persistent iTunes login issue has happened to me before as well. It seems a purchase gets stuck before being completed. For me, logging out of iTunes in my settings and then restarting my device helped.

  • rvantilborgrvantilborg Member, PRO Posts: 185

    i tried… doesn't work,just uploaded to itunes connect, lets see if it works then

  • QASaladQASalad Inactive, Chef Emeritus Posts: 142

    Getting the iTunes login on app start means you have a purchase associated with that account that did not complete successfully. Either fix it yourself by trying to consume the purchase (if it was consumable) or make another sandbox user. In sandbox, incomplete purchases usually clear out on a test account within 30 days.

  • rvantilborgrvantilborg Member, PRO Posts: 185

    i deleted all IAP in the game, if i upload to itunes connect, will other user experience that itunes login prompt? guess not right?

  • QASaladQASalad Inactive, Chef Emeritus Posts: 142

    @rvantilborg said:
    i deleted all IAP in the game, if i upload to itunes connect, will other user experience that itunes login prompt? guess not right?

    Only if their purchases don't go through successfully. But they shouldn't if your project's IAP logic is set up correctly.

  • rvantilborgrvantilborg Member, PRO Posts: 185

    i deleted it:)

  • rvantilborgrvantilborg Member, PRO Posts: 185

    deleted all IAP from game, so on my device it keeps asking for login, but on other devices it can't right?

  • QASaladQASalad Inactive, Chef Emeritus Posts: 142

    @rvantilborg said:
    deleted all IAP from game, so on my device it keeps asking for login, but on other devices it can't right?

    Ah. Yeah without IAP logic, other users won't see the issue. It's happening for you because you have a purchase associated with that bundle identifier (com.yourapp.whatever) and Sandbox is trying to log you in to fix it.

  • rvantilborgrvantilborg Member, PRO Posts: 185

    thanks!

  • @rvantilborg were you able to make you IAP work?? I'm trying to do the same thing but nothing works ... it's a nightmare :(

Sign In or Register to comment.