Android developer testing for an in-app purchase account must be performed using these keys.
Base64EncodedPublicKey
// Testing base64EncodedPublicKey
public static final String base64EncodedPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCg" + "KCAQEAhNe2XQ70DceAwE6uyYJGK1dIBbZcPdlER/9EEzylr6RDU6tnGj0Tk7kceN03GKvRf/ucT+ERLL3O" + "aHR22PXRXLZ17NZ81x6oS2vGmLyXBnjrU/I+asl8cNuLGySaoCdXxPAV+A9g6OG13dk+KY9i0O1roGpFH" + "fsAFyKCgSqR0PMJZ1bS+wFFBYf3M4IxgBcxuuZKDmR+MztCgm5N4zc6w2CwFZn3mXeDoTg15mWDU3sZO" + "WeRwFeynhV+FCYdDp8DpAkLk1b5IiXYFQ53wxCh/GxiKqBB6uQMmAixFjAcZV1QWfcBABae9vxiV5" + "VAEJvOOnhPxnaT9HYadW0pQ/UbJwIDAQAB";
And the item so acquired
ITEM_PURCHASED
// Testing ITEM_PURCHASED
public static final String ITEM_PURCHASED = "android.test.purchased";
And run this onCreate () code to initialize the IabHelper class for in-app purchase .
IabHelper helper = new IabHelper(this, Constants.base64EncodedPublicKey); helper.startSetup(new IabHelper.OnIabSetupFinishedListener() { public void onIabSetupFinished(IabResult result) { if (!result.isSuccess()) { Log.d("#InAppStartSetup#", "In-app Billing setup failed: " + result); } else { Log.d("#InAppStartSetup#", "In-app Billing setup successful."); } } });
And finally bought time on this code descriptor,
helper.launchPurchaseFlow(YOUR_ACTIVITY, Constants.ITEM_PURCHASED, YOUR_REQUEST_CODE, mPurchaseFinishedListener, "");
Thanks guys...
Najib Puthawala Feb 14 '15 at 11:12 2015-02-14 11:12
source share