IAP non-consumable question: What if the user does not wish to purchase after all?

mhedgesmhedges Raised on VCSMember Posts: 634

Hello -

It's been a long day, so please bear with me.

Concerning a non-consumable IAP, what should be the code if the player does not want to purchase after tapping on the purchase actor (not the yes button)?

I have an actor which must be tapped to invoke the purchase option. Code is:

Rule: If Actor touch is pressed and AdsRemoved = false then

Behavior 1: In-App Purchase Buy Item - Product ID Remove_Ads
Behavior 2: Change Attribute AdsRemoved = true
Behavior 3: Change Table Value IAP Table,1,2 to 1
Behavior 4: Save Table

That's all nice, but what if the player says, "nope, $0.99 is too much"?

Thanks, regards.

Best Answers

  • ArmellineArmelline Posts: 5,368
    edited August 2015 Accepted Answer

    You don't assign them the IAP until the purchase is confirmed - the fifth column of the PurchaseTable turns to "purchased". When that happens, you assign the IAP to the player. Once you've confirmed they've been given it, you consume the purchase. This turns the fifth column to "unpurchased" again. If they hit cancel, it is immediately changed to "unpurchased" and you need to give them nothing.

  • ArmellineArmelline Posts: 5,368
    Accepted Answer

    @mhedges said:
    Armeline, thanks for the response. So the questions beg:
    1. Do I make reference to the PurchaseTable and forget about the IAP Table I created?

    Most people make use of both. If you just rely on the PurchaseTable, it needs to be filled every time the app launches, rather than just went the player goes to the IAP screen/tries to buy something. The PurchaseTable will tell you the state of current purchases, but you should record when things are bought in your own table.

    1. Do I the destroy or obscure the actor if TableCellValue(PurchaseTable,1,5)="purchased"?

    Sorry, I misread your original post as "consumable" not "non-consumable". Ignore everything I said about "consuming" purchases.

    I recommend you hide the actor or show it as disabled when either ="purchased" or when your own record of their purchase is "true".

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

Answers

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @Armeline, thanks for the response. So the questions beg:
    1. Do I make reference to the PurchaseTable and forget about the IAP Table I created?
    2. Do I the destroy or obscure the actor if TableCellValue(PurchaseTable,1,5)="purchased"?

    Thanks again, regards.

  • mhedgesmhedges Raised on VCS Member Posts: 634

    @Armelline, I looked at the template and observed the behaviors. I do have another question, but from the itunesconnect side (related or not, depending on your reply) - for the behaviors to work correctly, do I have to "Host Content with Apple" or not? If I select it, then itunesconnect is waiting for some upload from me. Related?

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @mhedges said:
    Armelline, I looked at the template and observed the behaviors. I do have another question, but from the itunesconnect side (related or not, depending on your reply) - for the behaviors to work correctly, do I have to "Host Content with Apple" or not? If I select it, then itunesconnect is waiting for some upload from me. Related?

    You do not host any content with apple.

    Mental Donkey Games
    Website - Facebook - Twitter

Sign In or Register to comment.