GetBuyIntent returns null API version 3 in billing application

I am already checking my Internet connection and the Google Play market is installed with the latest version of the package.

In principle, Parable does not work, because buyIntent for in-app purchases returns null after the first use.

Here is the code, and I suspect the error is in this block (not somewhere else)

I also get this from the catch block, but I'm not sure what that means, the name of the package is changing since I don't want to show my application.

Error: (not from my package, but from the system level)

[79] InAppBillingUtils.getPreferredAccount: com.mypackage.appname: Account from first account - [jbC6uT04zd8tXCrK] 

code:

 Bundle buyIntentBundle = null; try { buyIntentBundle = mServiceConnection.mBillingService.getBuyIntent( 3, mContext.getPackageName(), mPurchaseCodesAsStrings[PurchaseType], "inapp", mDeveloperPayload ); } catch (RemoteException e) { e.printStackTrace(); } PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT"); 
+6
source share
1 answer

You get this error if you are using API version 3 and trying to re-buy the MANAGED in-app. All MANAGED products with version 3.

You should mainly consume MANAGED products that already exist before trying to buy again.

+10
source

Source: https://habr.com/ru/post/948107/


All Articles