Note that there are some explanatory texts on larger screens.

plurals
  1. POIn app billing API v3 INAPP_PURCHASE_DATA is null in bundle when onActivityResult is called
    text
    copied!<p>I am implementing subscription billing using the Version 3 Billing API. After the payment dialog has closed (payment succeeded), control is returned back to my activity </p> <p>Calling method</p> <pre><code> String payload = UUID.randomUUID().toString(); bundle = mService.getBuyIntent(3, getPackageName(), mProduct, "subs", payload); int responseCode = bundle.getInt("RESPONSE_CODE"); if (responseCode == 0) { PendingIntent pendingIntent = bundle.getParcelable("BUY_INTENT"); startIntentSenderForResult(pendingIntent.getIntentSender(), 1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0)); } else if (responseCode == 1) { mErrorMessage.setText(getResources().getString(R.string.purchase_cancelled)); mErrorMessage.setVisibility(View.VISIBLE); } else if (responseCode == 7) { mErrorMessage.setText(getResources().getString(R.string.payment_twice)); mErrorMessage.setVisibility(View.VISIBLE); } else { mErrorMessage.setText(getResources().getString(R.string.payment_general_error)); mErrorMessage.setVisibility(View.VISIBLE); } </code></pre> <p>My activity</p> <pre><code> @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == Activity.RESULT_OK) { // Null String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA" } } </code></pre> <p>The problem is that the purchaseData string is null. This might be because I have already purchased this subscription ( a million times when testing ) - and that I should have checked with getPurchases() first. </p> <p>Is it known for purchases to "go through - apparently with success", if the user tries to pay when he or she is 1) a current subscriber, or 2) in the period after cancelleation but before the service expires? </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