I am attempting to implement Google Play in-app purchase v3, after successfully implementing it in v2. However, every single time I attempt to purchase one of my real in-app products, I receive the following follow-up error:
IAB returned null purchaseData or dataSignature (response -1008:Unknown error)
This is coming from the IabHelper.java class, line 452:
if (purchaseData == null || dataSignature == null) { logError("BUG: either purchaseData or dataSignature is null."); logDebug("Extras: " + data.getExtras().toString()); result = new IabResult(IABHELPER_UNKNOWN_ERROR, "IAB returned null purchaseData or dataSignature"); if (mPurchaseListener != null) mPurchaseListener.onIabPurchaseFinished(result, null); return true; }
I have verified that a) my app is signed, b) the version of my app matches the draft version # on the Google Play store, and c) the user attempting the purchase has been added as a test user. I have tried this across 3 test accounts and 4 in-app purchase subscription types.
I had this problem myself. After a while I found what I did wrong. I was calling the wrong method on the IABHelper.
If you call mHelper.launchPurchaseFlow(...)
with an SKU that is registered as a subscription on Google Developer Console it will result in the error: IAB returned null purchaseData or dataSignature (response -1008:Unknown error).
If you have a SKU that is registered as an subscription you have to use the method: mHelper.launchSubscriptionPurchaseFlow(...)
instead.
Hope this helps.
error purchasing: iabResult: IAB returned null purchase Data or data Signature (response: -1008 unknown error)
if you get above error when you use launchPurchaseFlow() method and get this error check your product type. i was created subscriptions but i needed managed products for example Non-consumable product type. I mean be carefully about buying or subscriptions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With