I found that IabHelper.java has the following:
else if (resultCode == Activity.RESULT_CANCELED) { logDebug("Purchase canceled - Response: " + getResponseDesc(responseCode)); result = new IabResult(IABHELPER_USER_CANCELED, "User canceled."); if (mPurchaseListener != null) mPurchaseListener.onIabPurchaseFinished(result, null); }
I changed to this:
else if (resultCode == Activity.RESULT_CANCELED) { logDebug("Purchase canceled - Response: " + getResponseDesc(responseCode)); result = new IabResult(responseCode, "User canceled."); if (mPurchaseListener != null) mPurchaseListener.onIabPurchaseFinished(result, null); }
Note the change from (IABHELPER_USER_CANCELED, "User canceled.") To (responseCode, "User canceled")
Now the response code goes to
public void onIabPurchaseFinished(IabResult result, Purchase info)
therefore, I can determine whether the response will cancel the dialog and allow the active subscription to be reinstalled and communicate with my server. At this point, I am making a call to the 0Auth API on Google to verify the installation and the active subscription.
There may be alternative ways to do this, but it worked.
Hope this helps three people in the world who are subscribing to Android inapp.
PrivusGuru
source share