Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Noob_Vulcan · Mar 02, 2016 at 10:35 AM · iosiap

Restore IAP in IOS unity 5.3

As the documentation says "On Apple platforms users must enter their password to retrieve previous transactions so your application must provide users with a button letting them do so"

SO i should provide a simple button saying "Restore Purchase" and call

 public void OnInitialized(IStoreController controller, IExtensionProvider extensions)
 {
     extensions.GetExtension<IAppleExtensions> ().RestoreTransactions (result => {
         if (result) {
             // This does not mean anything was restored,
             // merely that the restoration process succeeded.
         } else {
             // Restoration failed.
         }
     });
 }

Is that it ?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
-1
Best Answer

Answer by phil_me_up · Mar 02, 2016 at 11:20 AM

Pretty much.

You only need to include this if you have non-consumable items as an IAP though (setup in iTunes Connect).

You'll also probably want to take some action in your UI / save data if it's not already handled to reflect the fact that some items may now be restored.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Noob_Vulcan · Mar 02, 2016 at 12:11 PM 0
Share

how do i get the information that some items are there that can be restored ?

The function doesn't manages everything automatically , once user has entered the password ? i.e i have only 1 IAP to be restored out of 3 IAP.

avatar image phil_me_up Noob_Vulcan · Mar 02, 2016 at 01:43 PM 0
Share

I don't use the Unity IAP API myself as we have our own system, but looking at the docs here: http://docs.unity3d.com/$$anonymous$$anual/UnityIAPRestoringTransactions.html the important lines are:

ANDROID "On platforms that support it (e.g. Google Play and Universal Windows Applications) Unity IAP automatically restores any products the user owns during the first initialization following reinstallation; the ProcessPurchase method of your IStoreListener will be called for each owned item."

IOS "During this process the ProcessPurchase method of your IStoreListener will be invoked for any items the user already owns.""

This means that any class which implements IStoreListener will have the ProcessPurchase method called on it, which is exactly the same function you should be calling when actually buying the item in the first place (and probably where you change UI states / update save data etc).

One important thing which many people overlook is that these objects should probably be active at the time of restoration. This means that you probably want to ensure that the IStoreListener item is on some game object that is always active (like in a manager class) rather than attached to a UI element.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

43 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Build with in-app purchase 1 Answer

Unity ads working on a direct Xcode build, but not when I download the app through App Store 0 Answers

Unity IAP in iOS, Restore question 0 Answers

Unity IAP not working on iOS, works on Android. 2 Answers

iOS IAP not working 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges