0

先週、一連のアプリ内購入のテストを行いましたが、すべて順調に進んでいます。ただし、チェックアウト時にコマンドをキャンセルしました。これは、Google Play がキャンセル通知を継続的に送信するためです。

どうやらgoogleplayは私の確認を理解せず、連続ループで通知してくれます。

onPurchaseStateChanged で、JSON 解析後:

ArrayList<String> confirmations = new ArrayList<String>();

for (Trans p : transactions)
{
    [...]
    if (p.purchaseState.ordinal() == PurchaseState.CANCELLED.ordinal())
         confirmations.add(p.notificationId);
}
if (!confirmations.isEmpty())
{
    final String[] notifyIds = confirmations.toArray(new String[confirmations.size()]);
    confirmNotifications(context, notifyIds);
}

.

public static void confirmNotifications(Context context, String[] notifyIds) 
{
    final Intent intent = createIntent(context, Action.CONFIRM_NOTIFICATIONS);
    intent.putExtra(EXTRA_NOTIFY_IDS, notifyIds);
    context.startService(intent);
}

私は何を間違っていますか?

4

1 に答える 1

0

ここで始めようとしているサービスは何ですか?あなた自身の?最終的には、Market/Play ストアの請求サービスにバインドしsendBillingRequest()、適切に入力されBundleた . あなたのコードはこれを行いますか?

于 2012-04-25T01:43:01.127 に答える