Skip to content
This repository has been archived by the owner on Apr 28, 2022. It is now read-only.

Unity queryInventory with SKUs #60

Closed
Death9 opened this issue Nov 21, 2013 · 9 comments
Closed

Unity queryInventory with SKUs #60

Death9 opened this issue Nov 21, 2013 · 9 comments

Comments

@Death9
Copy link

Death9 commented Nov 21, 2013

Hi,
It looks like the java method "public void queryInventory(String[] skus)" doesn't actually do anything with the skus.

Certainly every call I make to "OpenIAB.queryInventory(String[] skus)" doesn't fill in any SKU data.

Can you confirm this? Or have I read this wrong or done something wrong?

Many thanks.

@GrimReio
Copy link
Collaborator

Hello,

Yes, it doesn't do anythinig with skus. We should probably remove this method, it is a leftover from early API. :)
Please use 'queryInventory' without parameters.

Thank you.

@Death9
Copy link
Author

Death9 commented Nov 21, 2013

Hi,
Thanks for that.
I'll check again later but when I use queryInventory without parameters it doesn't fill in the SKU details either. I only get the purchase details. Is there any other information you'd like me to gather when I check?

@Death9
Copy link
Author

Death9 commented Nov 21, 2013

Yeah, it doesn't fill any SKU details in.

D/IabHelper(29925): Owned items response: 0
D/IabHelper(29925): Continuation token: null
D/IabHelper(29925): Querying SKU details.
D/IabHelper(29925): queryPrices: nothing to do because there are no SKUs.
D/OpenIAB-unity-plugin(29925): Query inventory finished.
D/OpenIAB-unity-plugin(29925): Query inventory was successful.

I/Unity (29925): queryInventorySucceededEvent: purchaseMap:{"AP1":{PurchaseInfo(type:inapp):{"orderId":"1234","packageName":"com.ELS.AT","productId":"ap1","purchaseTime":1384978951227,"purchaseState":0,"purchaseToken":""}}}; skuMap:{}

Would any more info be useful?

Thanks.

@GrimReio
Copy link
Collaborator

Are you sure, that you added your products to the store?
This method is simply a wrapper of store API and It queries info directly from the store.
Also please check that your bundle id in Unity matches one in the store.

Please let me know if it was helpful. Thank you.

@Death9
Copy link
Author

Death9 commented Nov 22, 2013

Hi, I think I've got everything set up correctly. I can purchase SKUs and see them on the Google Wallet Merchant page.
My APK is uploaded to the alpha testing section in the developer console and I've downloaded it from the secret play store link so everything is signed.
Running 4.3 on a Galaxy Nexus and 4.3 on a Nexus 7, both stock, not rooted.

The only other thing that might be affecting this is that I'm experiencing a crash on shut down, sorry I don't have the exact details at hand, something to do with IAB event not released exception and not calling through to superuser?
I think I might be calling the IAB init / mapSKU / register delegate out of order or that I don't release IAB in good time before the app closes. I was going to open another issues about this once I had more info but thought it might be relevant to this issue.

Thanks.

@Death9
Copy link
Author

Death9 commented Nov 25, 2013

It looks like this issue might be related to the package name.
Using the example code it correctly returns the skuMap but once I change the package name to my own app it only returns the purchaseMap.
My package name is in the form com.CompanyName.AppName, and matches what is displayed in the developer console.
Seems odd that I can buy items but not return the info for them. I'll keep looking.
Thanks again.

@GrimReio
Copy link
Collaborator

Please try this updated package.
https://dl.dropboxusercontent.com/u/18938411/OpenIAB-plugin.unitypackage

I've added 'queryInventory' with sku array param. It should work as expected and will be merged in master soon.
Looks like i misunderstood store API in first place. Version without params returns sku details only for already purchased products.

I hope this will be helpful. Thank you.

oorlov added a commit that referenced this issue Nov 27, 2013
Fix for #60 added queryInventory(string[] skus) method
@Death9
Copy link
Author

Death9 commented Nov 28, 2013

Hi Grim,
Many thanks for keeping me updated on this.
I hope that in some small way I've contributed to this effort by reporting
issues.
Thanks again.

On Wed, Nov 27, 2013 at 4:39 PM, GrimReio notifications@github.com wrote:

Please try this updated package.
https://dl.dropboxusercontent.com/u/18938411/OpenIAB-plugin.unitypackage

I've added 'queryInventory' with sku array param. It should work as
expected and will be merged in master soon.
Looks like i misunderstood store API in first place. Version without
params returns sku details only for already purchased products.

I hope this will be helpful. Thank you.


Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-29399096
.

@oorlov oorlov closed this as completed Nov 28, 2013
@GrimReio
Copy link
Collaborator

Hi,

Thank you very much for reporting bugs. This is very helpful indeed.
Please feel free to suggest any improvements.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants