Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Replace your <code>verifyPurchase()</code> method with below one. Use old code that given below, google developer are trying to solve this error in the near future but before they updated their code you should prefer below code. </p> <pre><code> public static boolean verifyPurchase(String base64PublicKey, String signedData, String signature) { if (signedData == null) { Log.e(TAG, "data is null"); return false; } boolean verified = false; if (!TextUtils.isEmpty(signature)) { PublicKey key = Security.generatePublicKey(base64PublicKey); verified = Security.verify(key, signedData, signature); if (!verified) { Log.w(TAG, "signature does not match data."); return false; } } return true; } </code></pre> <p>check this link for more information: </p> <p><a href="https://stackoverflow.com/questions/19534210/in-app-billing-not-working-after-update-google-store/19539213#19539213">In App billing not working after update - Google Store</a> </p> <p>Use try to replace OLD CODE method <code>verifyPurchase()</code> method in your project. But It should be only happens when you are trying to purchase test products. Let me know for the real products purchase also after using this code.</p> <p><strong>Edit:</strong></p> <p><strong>Why it happens</strong> because we will not get any signature while we are using dummy product like "android.test.purchased". So in the old code it is working good because we were return true even if signature is not given and for the New code we are returning false.</p> <p>more information about the signature data null or blank from link1 and link2</p> <p>So I suggest you just replace old code method <code>verifyPurchase()</code> instead of New Code method.</p> <p>I think may be New Code will work fine for the real product but not in the dummy product. But yet I have not tested for the real product.</p> <p><strong>or</strong> </p> <p>use GvS's answer for the test purchases it also the good solution for the new code.</p> <p>Hope it will solve your problem.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload