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 ErwinTerpstra · Aug 09, 2016 at 02:36 PM · androidiap

ProcessPurchase not called on startup (Android)

Hi, I'm trying to get the Unity IAP system working on Android. Almost everything seems to work. But when I restart my app, the ProcessPurchase method is not called. Therefore the purchased items are not unlocked in-game. From what I can read in the documentation (https://docs.unity3d.com/Manual/UnityIAPRestoringTransactions.html), this method should be called automatically.

The logcat output indicates the items are marked as 'owned'. But because the transaction is already recorded, it isn't processed again? How do I get Unity to call ProcessPurchase for these purchases?

EDIT: Okay, I just found out that it does work the first time the app starts after installing it. So it seems Unity assumes you locally keep track of what should be unlocked with the user's purchases? This seems more prone to users gaining content by modifying local data.

I/UnityIAP(25500): Starting in-app billing setup.
I/UnityIAP(25500): Billing service connected.
I/UnityIAP(25500): invoking callback
I/UnityIAP(25500): Checking for in-app billing 3 support.
I/UnityIAP(25500): In-app billing version 3 supported for com.grendelgames.garfield.dev
I/UnityIAP(25500): Subscriptions AVAILABLE.
I/UnityIAP(25500): onIabSetupFinished: 0
I/UnityIAP(25500): Requesting 5 products
I/UnityIAP(25500): QueryInventory: 5
I/UnityIAP(25500): invoking callback
I/UnityIAP(25500): Querying owned items, item type: inapp
I/UnityIAP(25500): Package name: com.grendelgames.garfield.dev
I/UnityIAP(25500): Calling getPurchases with continuation token: null
I/UnityIAP(25500): Owned items response: 0
I/UnityIAP(25500): Sku is owned: com.grendelgames.garfield.venice
I/UnityIAP(25500): Sku is owned: com.grendelgames.garfield.amsterdam
I/UnityIAP(25500): Sku is owned: com.grendelgames.garfield.world_pass
I/UnityIAP(25500): Continuation token: null
I/UnityIAP(25500): Querying SKU details.
I/UnityIAP(25500): Querying owned items, item type: subs
I/UnityIAP(25500): Package name: com.grendelgames.garfield.dev
I/UnityIAP(25500): Calling getPurchases with continuation token: null
I/UnityIAP(25500): Owned items response: 0
I/UnityIAP(25500): Continuation token: null
I/UnityIAP(25500): Querying SKU details.
I/UnityIAP(25500): onQueryInventoryFinished: true
I/UnityIAP(25500): Inventory refresh successful. (response: 0:OK)
I/Unity   (25500): Already recorded transaction kjeobmbgeedimmihldkgmhln.AO-J1OxXpvh1fbvFr52xxml7FfhNOurKv9J1D50dEtEZ5KNac-c450AH3LnGT1VJENIy0bHz9TlXFeDHTuMhyWD_Nq-7LCBrgnzUmuOExNak4qZC6-rb1YuUiKUDibEgXXAKe9c1FE7fhM5bgrgSTlU3WWEYh9erKucaFFKNKiwiPx2CqO81oKQ
I/UnityIAP(25500): Finish transaction:kjeobmbgeedimmihldkgmhln.AO-J1OxXpvh1fbvFr52xxml7FfhNOurKv9J1D50dEtEZ5KNac-c450AH3LnGT1VJENIy0bHz9TlXFeDHTuMhyWD_Nq-7LCBrgnzUmuOExNak4qZC6-rb1YuUiKUDibEgXXAKe9c1FE7fhM5bgrgSTlU3WWEYh9erKucaFFKNKiwiPx2CqO81oKQ
I/Unity   (25500): Already recorded transaction hopfojbbnobcbjnhaddiioim.AO-J1Oxz0BcfyzBvzuLF9ewS07S_GGA1-7RxxuOYfpxApdSD4hCK0_0Z0TSGspJRQPCsJomyZQ3x30O246MMnL0Lhrv68ZV-KlnvQW9aeJX3aL5bKiqmIOA5u-NFIdRjrtqavWzl6sf5NxXn83j5bqFl-mG_ovQw_g
I/UnityIAP(25500): Finish transaction:hopfojbbnobcbjnhaddiioim.AO-J1Oxz0BcfyzBvzuLF9ewS07S_GGA1-7RxxuOYfpxApdSD4hCK0_0Z0TSGspJRQPCsJomyZQ3x30O246MMnL0Lhrv68ZV-KlnvQW9aeJX3aL5bKiqmIOA5u-NFIdRjrtqavWzl6sf5NxXn83j5bqFl-mG_ovQw_g
I/Unity   (25500): Already recorded transaction docaedeeiifnldmgnhenblgd.AO-J1OyOtVQdvUibLO10J1UGJkuAGEnDHKZ1BHuIXUNUWZpyJ2D-i2wiI3du6jw7UNHNPOWonz-g2UQQXpR2J5_4Pe4bR-JIuQ99Pvqh0_pdDvYBWu0aJkH7bsp8Co7FaTY8OmUjCHXdC8Nfo1vJoIUM-AaO2_ArFwf1yUHp-ATcGc4NwWloj60

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Magicware · Dec 12, 2016 at 08:13 AM

Same issue here. Check this out: https://forum.unity3d.com/threads/restore-purchases-not-working-in-unity-iap-android.418919/

Comment
Add comment · 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
0

Answer by Kurius · Jun 23, 2017 at 07:18 PM

Here's one solution... https://forum.unity3d.com/threads/restore-transactions-via-codeless-iap.479251/

Comment
Add comment · 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

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

IAP able to keep buying Non Consumable 0 Answers

How to properly handling iOS/Android IAP-refund in realtime 0 Answers

UnityIAP not restoring purchases on Android 1 Answer

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

Samsung Galaxy Apps IAP 3 error 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