简体   繁体   中英

getBuyIntent returns null API version 3 in-app billing

I'm already checking for Internet connection and that Google Play market is installed with the latest package version.

Basically the Parable is failing because the buyIntent for in-app purchases is returning null after the first time it is used.

Here is the code and I suspect the error to be in this block (no where else)

I'm also getting this returned from the catch block but I'm not sure what it means, the package name is changed as I don't want my app to be shown.

Error: (Not from my package but 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");

You get this error if your using API version 3 and your trying to re-purchase a MANAGED in-app product. All products are MANAGED with version 3.

You've got to basically consume the MANAGED products that already exist before trying to purchase again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM