Important Info on How IAP's Will Work in an Upcoming Release!
Hello again everyone. I've been given some more important information to pass on to you guys, read on!
In order to take advantage of updates with Apple's IAP system (as well as Amazon and Google) the current IAP behaviors are being deprecated, and replaced with new ones. These new behaviors are focused around a new system-created table called PurchaseTable. Important: If a user has a game with a table already called PurchaseTable, they should rename it, save their game, and reload it so the system PurchaseTable can be created.
PurchaseTable has 5 columns: Id, Consumable, Name, Price, State. The users (you guys) need to fill in the Id and Consumable columns; the rest are filled in by the new IAP behaviors.
Definitions of what the 5 columns will hold:
Id: the IAP provider item id.
Consumable: flag that the item is consumable (can be bought multiple times). A consumable item can't be repurchased until . the Consume Item behavior is run.
Name: The localized name of the item.
Price: The localized price of the item.
State: The purchase state of the item. Can be "unpurchased", "pending", or "purchased".
The new IAP behaviors are:
In App Purchase - Request Purchase Data: Sends a message to the IAP provider to get the localized name and price info for items. You pass in the start and end indexes of the PurchaseTable for the items you want to get (if the end index is -1, the last table row will be used). You also have to give it a callback attribute. This works the same as the network behaviors’ callback attribute: it is initialized to 0 when the behavior is run, and set to 1 when the data is received, and -1 if there was an error, such as no network connection.
Note that when displaying IAP item data, show the name and price as given in the table. This will be localized by the IAP provider to the appropriate format for the player.
In App Purchase - Restore Items: Sets the "state" column of any items purchased by the player, including consumable items that haven't been consumed. This behavior should be called near the start of a game, after the purchase table has been initialized. There should also be a way for the player to trigger this behavior, in case the initial call couldn't be made.
In App Purchase - Buy Item: Attempts to buy an item. The item state will be set to "pending" until the item is purchased or canceled. It's important to understand that the purchase may not be completed immediately after, or even during the same session as when the request is made.
In App Purchase - Consume Item: Flags a consumable item as "unpurchased" so it can be purchased again. Until Consume Item is called, a consumable item may not be repurchased.
Lastly, games should be changed to use the new system, as the old IAP behaviors will be removed in a future release of GameSalad.
Comments
Interesting - looks like a new set of IAP tutorial vids will be coming soon.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
The old GameSalad IAP system is official deprecated; please move your games over to this new GameSalad IAP system.
The next RC 0.12 will have this new system to allow you start moving your games over before the final release.
Thanks @ForumNinja
@BlackCloakGS, what happens if the user is offline the first time the app is run? Will the Price, Name and State columns be empty?
Also...
Does this mean a user can not buy two bundles of hearts at once?
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
1) Yes. Ideally, you should call Request Purchase Data some time before they get to your purchase screen. If they get to the screen and the name/price values are empty, display a message saying that the IAP provider you're using cannot be connected to.
2) Yes. If you want to have the effect of buying multiple groups of items, you will need to set up a separate purchasable item.
Thanks @stevej, but I phrased it wrong. I will try again:
Does it mean that a user can no longer buy two of the same item, one after the other, without first using up the first one?
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
An official GS tutorial would be nice for this one @BlackCloakGS
GAMESALAD DEV FOR HIRE! - www.gingagaming.com
@gingagaming we will getting a example template and more in-depth docs to you guys soon.
Yes. "Consume Item" is used to tell the IAP provider that you're acknowledging the purchase, so that a) when Restore Items is called the consumable won't be in the list, and b) the consumable can be purchased again. Ideally this should be the flow of a consumable purchase:
1) Call Buy Item.
2) Continue the game until the item's state in the PurchaseTable is set to "purchased".
3) Adjust an attribute for the amount of the consumable purchased, and save the attribute.
4) Call Consume Item.
This does lead to a very, very small time between 3 and 4 where the user could shut down your game, and get the purchase again without paying for it. It is possible to switch 3 and 4, but then you'll get a time where it's possible for the user to lose the purchase. It's up to you to decide which risk is preferable.
You can pause your game during step 2, but, if you are publishing for iOS, there could be up to a day between when a purchase is requested and when it actually goes through, due to the new family sharing system on iOS.
Thank you for the detailed explanation @stevej ! Its clear now.
It also seems like non-consumables can now just be checked against the PurchaseTable (state "Purchased") and no longer need to be maintained in our own separate table?
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
I would like to get my hands on this asap. Even a working example with a little commentary in this thread would be a big help. You could do a more polished one after that. It would save us a lot of time and you the headache of answering a barrage of question, a lot of them would be the same questions over and over in multiple threads.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
Correct. Just call Restore Items to make sure you've got the most recent update.
Great, thank you.
Although this would apply to a self-maintained item cache just as well.
So we just offer the mandatory "Restore Items" button.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@stevej Is what Hopscotch said about non-consumables correct? An example of this would also be helpful. I have two games almost ready for submission that only have "remove ads" and "unlock levels" as IAPs.
For non-consumables, the general flow should be:
1) Call Buy Item.
2) Continue the game until the item's state in the PurchaseTable is set to "purchased"
No other calls needed.
@stevej That was quick. Thank you sir.
@stevej Do you think we should wait until Apple introduce Family Purchases, and you guys have had a chance to sort out how GS handles them, before we submit any more apps?
Wait a minute is this only in the release candidate or is it in a new stable release?
I assume we need an update if this table is system generated.
...
@BlackCloakGS if I submitted a game to apple for review today with IAP, will my current IAP system still be valid?
it is valid for iOS 5,6, and 7
Sorry maybe my question was stupid.
sorry about that I had entered the wrong info and could not delete my post at the time. We should have 0.12 RC out tomorrow with the 0.12 stable coming out before iOS next week. It will have the new IAP system as well as the encrypted projects.
Great! My question was't stupid!
Cool the stable release with encryption and new IAP is most welcome news.
Does this mean that the in-apps in our live apps on the app store won't work if someone has iOS 8?
So essentially we would need to update every app that has in-apps asap before iOS 8 goes live with this new format? This is horrible news if that's the case as millions of people will be updating to iOS 8 asap. On top of that this new in-app method isn't available for us to implement yet. Then we need to wait for apple to review the apps.
Am I the only one worried about the loss in revenue? Not cool!
@games4fun
The GameSalad team is working as fast they can and I believe that you won't lose too much money.
We are trying to get this to you as fast as possible. I am not sure what Apple with do with older apps the main reason we need to update was to support child request (pending ) purchases . I do know that child request purchases with iOS 8 will not work in our old IAP system. You will need to update to our new IAP system.
Ooh this is a bugger.
Superb! Just before I start adding IAPs too.
Like Balls? Then click here! We've 100 coming soon
do these IAPs work with the Kindle Fire Devices and Windows 8?
Yes on the kindle fire. No on Windows 8