Android。 Google Play在应用内购买

时间:2014-09-16 15:27:31

标签: java android in-app-purchase google-play

我想在我的应用中创建一个用于删除广告的部分。但我有一个问题。我应该在代码中编写什么而不是developerPayload?

ArrayList skuList = new ArrayList();
    skuList.add(inappid);
    Bundle querySkus = new Bundle();
    querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
    Bundle skuDetails;
    try {
        skuDetails = mService.getSkuDetails(3, getPackageName(),
                "inapp", querySkus);

        int response = skuDetails.getInt("RESPONSE_CODE");
        if (response == 0) {

            ArrayList<String> responseList = skuDetails
                    .getStringArrayList("DETAILS_LIST");

            for (String thisResponse : responseList) {
                JSONObject object = new JSONObject(thisResponse);
                String sku = object.getString("productId");
                String price = object.getString("price");
                if (sku.equals(inappid)) {
                    System.out.println("price " + price);
                    Bundle buyIntentBundle = mService
                            .getBuyIntent(3, getPackageName(), sku,
                                    "inapp",
                                    "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                    PendingIntent pendingIntent = buyIntentBundle
                            .getParcelable("BUY_INTENT");
                    startIntentSenderForResult(
                            pendingIntent.getIntentSender(), 1001,
                            new Intent(), Integer.valueOf(0),
                            Integer.valueOf(0), Integer.valueOf(0));
                }
            }
        }
    } catch (RemoteException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (JSONException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (SendIntentException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

这是代码的一部分。我想知道我应该写什么而不是bGoa + V7g / yqDXvKRqq + JTFn4uQZbPiQJo4pf9RzJ?

0 个答案:

没有答案