
version 3 の API の基本は上記のエントリ及び Implementing In-app Billing (IAB Version 3) を見てください。
version 3 の subscriptions の購入フローはプロダクト購入フローとほぼ同じなので、上記のエントリを先にみることをオススメします。
Implementing Subscriptions
Subscription の購入フローもプロダクト購入フローとほぼ同じで、違う点は product type が "subs" である点です。購入結果は Activity の onActivityResult メソッドで受けとります(in-app products と同じ)。
- Bundle bundle = mService.getBuyIntent(3, "com.example.myapp", MY_SKU, "subs", developerPayload);
- PendingIntent pendingIntent = bundle.getParcelable(RESPONSE_BUY_INTENT);
- if (bundle.getInt(RESPONSE_CODE) == BILLING_RESPONSE_RESULT_OK) {
- // Start purchase flow (this brings up the Google Play UI).
- // Result will be delivered through onActivityResult().
- startIntentSenderForResult(pendingIntent, RC_BUY, new Intent(), Integer.valueOf(0), Integer.valueOf(0), Integer.valueOf(0));
- }
- Bundle activeSubs = mService.getPurchases(3, "com.example.myapp", "subs", continueToken);
0 件のコメント:
コメントを投稿