I am very close to shipping a iOS/Android game, but I am stuck on how to Restore In-App Purchases in Unreal. As this is a requirement for non consumable In-App purchases I cannot move forward with the game/marketing until this is figured out.
In this forum thread it is stated that Restoring Purchases in Blueprints should be in 4.8.
As of 4.8 Preview 1, that functionality is still not exposed. Restoring purchases was mentioned in the most recent Twitch stream titled “Unreal Engine Support - Mobile Development”, but they even said it was still not yet exposed.
If restoring in-app purchases is not making 4.8 (also i would like to not have to wait for 4.8.0), could I please get pointed in the right direction on making that functionality myself? This is a Blueprints only game, but I do have some coding experience (very little Java/C++/C) and am willing to put in the time and effort to try and figure this out.
I guess I need to know how to access the OnlineSubsystemIOS.Store and get its list of functions to see what even needs to be called. There is no documentation on this so I am going into this completely blind. Any help is appreciated.
After looking into restoring In-App purchases(iOS) with code it seems that as long as the App Receipt is up to date the “Receipt Data” string returned in the InAppPurchaseProductInfo should be just fine to check if the item was purchased. Although if the App Receipt is not current, you are supposed to restore the App Receipt via SKReceiptRefreshRequest in the StoreKit.
I double checked OnlineStoreInterfaceIOS.cpp and the GooglePlayStore.cpp(forgot what it was called), and both do return the unencrypted Receipt Data that is available via the “Read In-App Purchase Information” blueprint node.
So I am thinking that for restoring purchases, I need to request the App Receipt via “SKReceiptRefreshRequest”. Then on success of that check each product’s “Receipt Data” via the blueprint node “Read In-App Purchase Information”.
That said, I am still not sure what the “Receipt Data” string will contain when purchased or not. Also I do not know if calling the “Read In-App Purchase Information” blueprint node is only looking locally, or checking via the AppStore (my best guess is locally).
I was going to post my own question but I saw this. I’m also in the same situation. Will 4.8 eventually have it or does anyone have a guide to restoring purchase with code? I would rather not have to release 2 different versions for my game.
Well looks like it will be a while maybe September or October before there is a blueprint node for this. I would have thought this was an important money making feature since most apps now use in app purchases.
It looks like restoreCompletedTransactions would need to be added to the OnlineStoreInterfaceIOS.cpp in order to use code to restore the purchase. No idea how hard that would be as I haven’t coded in a while.
MetalMafia - have you tested “Read In-App Purchase Information” in sandbox mode? I was only able to test in app purchase with “Free Subscription” type because I haven’t completed the contract agreements. When I purchased it gave back receipt data but with “Read In-App Purchase Information” it gave the info about the in app purchase but did not give receipt data back. Not sure if “Non-Consumable” type will be any different as I couldn’t get it to work.
Well I really wish for this to happen as soon as possible, my game is basically finished, I just need some In-App purchases as well, but I don’t want that system to be really inflexible (no restoring f.e.), so that’s pretty sad right now
Let’s hope Epic helps us here in the near future (as this is really necessary for mobile games imo …?)