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 davidb1 · Jul 26, 2016 at 09:20 AM · unity 5iappurchase

Unity In-App Purchasing - Reset

Hey, is there currently a way to reinitialize/reset the Unity IAP once Initialize was already called? This is for a case where I need to change the items I added at first

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
0
Best Answer

Answer by nicholasr · Jul 26, 2016 at 06:47 PM

@davidb1 Adding items is possible with Unity 5.4's FetchAdditionalProducts

Deleting items is not possible, currently.

Would you mind sharing a description of the use-case for, if this is what is desired, deleting items from the IAP layer?

Comment
Add comment · Show 3 · 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 davidb1 · Jul 27, 2016 at 07:28 AM 0
Share

Fetching more products would work but it isn't the best solution, what if each of my users gets the products based on his "stats". If a user logs out and another logs in, I would want to get different products for this user.

Reseting the IAP would do the same but better - it would save me the check whether there are items that both users should be getting (which currently throws an exception when I try to add the same items twice)

avatar image nicholasr davidb1 · Jul 27, 2016 at 06:25 PM 0
Share

A workaround for that case is building and maintaining a local intermediate copy of the per-user product list. Purge the list on log out. Use that list as the 'source of truth' ins$$anonymous$$d of Unity IAP's list of Product objects.

Thanks for sharing this reset "life cycle" use-case - we'll take it into consideration for a future upgrade to the Unity IAP API.

avatar image davidb1 nicholasr · Jul 28, 2016 at 07:32 AM 0
Share

Problem is, since Unity IAP's product list can't be cleared and already has an item with the same store ID as the one I try to initialize, I will get an exception (Unity IAP's dictionary already contains that item).

So I have to remember locally which products I have already initialized with Unity IAP and which I haven't (users may have the same products so I have to avoid initializing the same products with Unity IAP more than once).

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

86 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 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

Unity In app purchases - non-consumable Duplicate Transaction on Android 1 Answer

FetchAdditionalProducts - Unity 5.4 1 Answer

in app purchase sooma restore option 1 Answer

unity3d google play error [DF-RPC-01] 1 Answer

In iOS, IAP With Sandbox User Works But It Fails With Non-Sandbox Users 0 Answers


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