计费\响应\结果\错误android应用程序购买AIDL?

计费\响应\结果\错误android应用程序购买AIDL?,android,in-app-purchase,in-app-billing,aidl,Android,In App Purchase,In App Billing,Aidl,我的应用程序有应用内产品可供购买。直到昨天,消费者才能够购买这些产品,但从今天早上开始,只有我继续记录账单、回复、结果和错误。有人能带我去修理吗 下面是我的购买流程代码 Bundle activeSubs = null; try { activeSubs = inAppBillingService.getPurchases(3, currentActivity.getP

我的应用程序有应用内产品可供购买。直到昨天,消费者才能够购买这些产品,但从今天早上开始,只有我继续记录账单、回复、结果和错误。有人能带我去修理吗

下面是我的购买流程代码

Bundle activeSubs = null;
                try {
                    activeSubs = inAppBillingService.getPurchases(3,
                            currentActivity.getPackageName(),
                            "subs",
                            null);
                } catch (RemoteException e) {
                    //Log.e(TAG, "Failed to retrieve current active subscriptions: " + e.getMessage());
                }

                ArrayList<String> subscribedSkus = null;

                if (activeSubs != null) {
                    subscribedSkus = activeSubs.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
                }

                Bundle buyIntentBundle;
                if (subscribedSkus != null && !subscribedSkus.isEmpty()) {
                    //Log.d(TAG, "Initiating upgrade purchase");
                } else {
                    //Log.d(TAG, "Initiating new item purchase");
                }

                buyIntentBundle = inAppBillingService.getBuyIntentToReplaceSkus(5,
                        currentActivity.getPackageName(),
                        subscribedSkus,
                        skuToPurchase,
                        "subs",
                        null);

                if (buyIntentBundle != null) {
                    int resultCode = buyIntentBundle.getInt("RESPONSE_CODE");
                    if (resultCode == 0) {
                        PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
                        if (pendingIntent != null) {
                            //Log.d(TAG, "Launching intent to initiate item purchase");
                            currentActivity.startIntentSenderForResult(pendingIntent.getIntentSender(),
                                    RC_PURCHASE_PLAY_STORE_ITEM,
                                    new Intent(),
                                    0,
                                    0,
                                    0);
                        } else {
                            showToast(getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.app_cms_cancel_subscription_subscription_not_valid_message)),
                                    Toast.LENGTH_LONG);
                        }
                    } else {
                        if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_USER_CANCELED) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_user_canceled)), false, null, null);
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_SERVICE_UNAVAILABLE) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_service_unavailable)), false, null, null);
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE) {
                            addGoogleAccountToDevice();
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_item_unavailable)), false, null, null);
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_DEVELOPER_ERROR) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_developer_error)), false, null, null);
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ERROR) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_result_error)), false, null, null);
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_item_already_purchased)), false, null, null);
                        } else if (resultCode == IabHelper.BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED) {
                            showDialog(DialogType.SUBSCRIBE, getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription_billing_response_item_not_owned)), false, null, null);
                        }
                    }
                }
Bundle-activeSubs=null;
试一试{
activeSubs=inapplingservice.getPurchases(3,
currentActivity.getPackageName(),
“潜艇”,
无效);
}捕获(远程异常){
//Log.e(标记“检索当前活动订阅失败:”+e.getMessage());
}
ArrayList subscribedSkus=null;
if(activeSubs!=null){
SubscribedKUS=activeSubs.getStringArrayList(“INAPP\u采购项目列表”);
}
捆绑购买意向性捆绑;
if(subscribedKUS!=null&!subscribedKUS.isEmpty()){
//Log.d(标签“启动升级采购”);
}否则{
//日志d(标签“启动新项目采购”);
}
buyIntentBundle=inAppBillingService.getBuyIntentToReplaceSkus(5,
currentActivity.getPackageName(),
库斯先生,
skuToPurchase,
“潜艇”,
无效);
if(buyententbundle!=null){
int resultCode=buyententbundle.getInt(“响应代码”);
if(resultCode==0){
PendingIntent PendingIntent=buyIntentBundle.getParcelable(“购买意向”);
如果(PendingEvent!=null){
//Log.d(标签“启动项目采购的启动意图”);
currentActivity.startIntentSenderForResult(PendingEvent.getIntentSender(),
RC\u采购\u游戏\u商店\u物品,
新意图(),
0,
0,
0);
}否则{
showToast(GetLanguageResourceFile().getUIresource(currentActivity.getString(R.string.app\u cms\u cancel\u subscription\u not\u valid\u message)),
吐司长度(长);
}
}否则{
if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u USER\u cancelled){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u result\u user\u Cancelled)),false,null,null);
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u SERVICE\u UNAVAILABLE){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u result\u service\u unavailable)),false,null,null);
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u BILLING\u UNAVAILABLE){
addGoogleAccountToDevice();
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u ITEM\u不可用){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u result\u item\u unavailable)),false,null,null);
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u DEVELOPER\u ERROR){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u result\u developer\u error)),false,null,null);
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u ERROR){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u result\u error)),false,null,null);
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u ITEM\u已拥有){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u item\u Haven\u purchased)),false,null,null);
}else if(resultCode==IabHelper.BILLING\u RESPONSE\u RESULT\u ITEM\u NOT\u OWNED){
showDialog(DialogType.SUBSCRIBE,getLanguageResourcesFile().getUIresource(currentActivity.getString(R.string.subscription\u billing\u response\u item\u not\u owned)),false,null,null);
}
}
}

不知道是什么导致了问题。必须更改一点代码

 Bundle activeSubs = null;
                try {
                    activeSubs = inAppBillingService.getPurchases(3,
                            currentActivity.getPackageName(),
                            "subs",
                            null);
                } catch (RemoteException e) {
                    //Log.e(TAG, "Failed to retrieve current active subscriptions: " + e.getMessage());
                }

                ArrayList<String> subscribedSkus = null;

                if (activeSubs != null) {
                    subscribedSkus = activeSubs.getStringArrayList("INAPP_PURCHASE_ITEM_LIST");
                }

                Bundle buyIntentBundle;
                if (subscribedSkus != null && !subscribedSkus.isEmpty()) {
                    //Log.d(TAG, "Initiating upgrade purchase");
                } else {
                    //Log.d(TAG, "Initiating new item purchase");
                }
                String purchasePayload = "subs" + ":" + skuToPurchase;
                /*buyIntentBundle = inAppBillingService.getBuyIntentToReplaceSkus(5,
                        currentActivity.getPackageName(),
                        subscribedSkus,
                        skuToPurchase,
                        "subs",
                        purchasePayload);*/
                buyIntentBundle = inAppBillingService.getBuyIntent(3,
                        currentActivity.getPackageName(),
                        skuToPurchase,
                        "subs",
                        purchasePayload);
Bundle-activeSubs=null;
试一试{
activeSubs=inapplingservice.getPurchases(3,
currentActivity.getPackageName(),
“潜艇”,
无效);
}捕获(远程异常){
//Log.e(标记“检索当前活动订阅失败:”+e.getMessage());
}
ArrayList subscribedSkus=null;
if(activeSubs!=null){
SubscribedKUS=activeSubs.getStringArrayList(“INAPP\u采购项目列表”);
}
捆绑购买意向性捆绑;
if(subscribedKUS!=null&!subscribedKUS.isEmpty()){
//Log.d(标签“启动升级采购”);
}否则{
//日志d(标签“启动新项目采购”);
}