- Home /
Restoring In App Purchases for iOS using Unity
I want to create a button that allows the user to restore their In App purchases if they ever delete and re-install the game.
I am using Unity 4 for iOS specifically.
I have done this in objective-c using Cocos2D but I know that it does not work the same way.
Does anyone know any code snippets or links to a tutorial that can help me gain access to what has been purchased and restore these for the user?
Would be greatly appreciated.
your question is from 2013 - did you solve it? did you know how it works? if yes please share the solution with us/me.
I have the same question, please share if you solved!!!
Answer by nicholasr · Aug 10, 2016 at 11:41 PM
If using Unity IAP to access the user account's IAP, then use the iOS store Extension API to trigger the restoration.
Docs: http://docs.unity3d.com/Manual/UnityIAPiOSMAS.html
// Inside class inheriting from Unity IAP IStoreListener interface public void OnInitialized(IStoreController controller, IExtensionProvider extensions) { extensions.GetExtension ().RestoreTransactions (result => { if (result) { // This does not mean anything was restored, // merely that the restoration process succeeded. } else { // Restoration failed. } }); }
Your answer
Follow this Question
Related Questions
Everyplay for Unity3D - Error for building on iOS 0 Answers
Stop Threads in Unity3d using C# 0 Answers
Xcode hook up with Unity 1 Answer
Unity ads working on a direct Xcode build, but not when I download the app through App Store 0 Answers
Runs fine in editor, crash on switch platform to iOS. 0 Answers