2. トピックス
● Google
○ Google Play Billing Library
○ Google Play Developer API
● Apple
○ AppStore Server Notifications
○ Test an Interrupted Purchase
2
3. Google Play Billing Library
■Android 課金ライブラリ
昔:AIDL / IAB Helper
今:Google Play Billing Library
■2021年にはBilling Libraryのv3以降が必要
新規アプリは2021/08/02〜
既存アプリは2021/11/01〜
■Billing Libraryは今後毎年更新され、アプリ開発者も毎年アップデートが必要
2022年にはv4以降、2023年にはv5以降…
3
※Android Developers Blog
https://android-developers.googleblog.com/2020/06/meet-google-play-billing-library.html
4. Google Play Billing Library - Acknowledge
■ Billing Library v2で生まれた新しい概念 Acknowledge (承認)
3 日以内に購入を承認しない場合、ユーザーは自動的に払い戻しを受け、Google Play は購入を取り消します。
4
※Billing Library Overview
https://developer.android.com/google/play/billing/billing_library_overview
5. Google Play Billing Library - Acknowledge
■ 例えば…
5
ユーザー課金
課金処理
(アイテム付与)
Acknowledge
/ Consume
3日間このままだと
自動的に払い戻し
アプリクラッシュ?
通信障害?
6. Google Play Billing Library - Acknowledge
6
ユーザー課金
課金処理
(アイテム付与)
Acknowledge
済みなら
Acknowledge
アプリサーバ
3日間このままだと
自動的に払い戻し
7. Google Play Developer API
■大別すると2種類のAPI
・Subscriptions and In-App Purchases API
・Publishing API
■できること
・ユーザーのアプリ内商品購入のステータス取得・操作(返金・キャンセル・Acknowledgeなど)
・ユーザーによる返金のリスト取得
・アプリバイナリのアップロード・公開
・ユーザのレビュー取得・返信
7
※Google Play Developer API
https://developers.google.com/android-publisher
8. Google Play Developer API - サブスクリプション
■サブスクリプション型のアプリ内購入にはサーバーAPIがほぼ必須?
・サブスクリプションはアプリの外(Google Play)で解約できる
・アプリ起動していない購読中のユーザが、現在も購読中か?など、状況を知りたいケースが多い
■Real-time Developer Notifications(RTDN)
・購読状況の変化をリアルタイムに監視するためには通知型の機能も合わせて利用
8
※RESTリソース:purchases.subscriptions
https://developers.google.com/android-publisher/api-ref/rest/v3/purchases.subscriptions
※リアルタイム デベロッパー通知のリファレンス ガイド
https://developer.android.com/google/play/billing/rtdn-reference
9. Google Play Developer API - リクエスト上限に注意
■Google Play Developer APIのリクエストは200,000req/日まで
・その開発者アカウントの全アプリの合計なので、提供しているアプリが多い開発者ほど注意が必要
■Google Play Developer APIを採用する際は…
・自分たちの提供しているアプリ1つ1つが、どのくらいAPIを使うのか/使っているのかを管理
・200,000req/日では足りない場合、上限引き上げを申請
9
※Google Play Developer API - Quotas
https://developers.google.com/android-publisher/quotas
10. App Store Server Notifications
■設定したサーバーに以下2種類の通知が届く機能
・サブスクリプションの購読状況の変化を通知(更新やキャンセルなど)
・ユーザーによる返金情報の通知
■サブスクリプション関連機能としてはGoogleのRTDNに相当する
・使わなくてもサブスクリプションは実現できるが、
購読状況の変化管理のリアルタイム性を上げるために有用
10
※App Store Server Notifications
https://developer.apple.com/documentation/appstoreservernotifications
14. 今日話したこと
● 期限が決まっていて対応しないといけない
○ Google Play Billing Library
● 特にサブスクリプションで活用機会の多いサーバーAPI
○ Google Play Developer API
○ AppStore Server Notifications
● 新OS(iOS14)に合わせて追加された課金テスト関連機能
○ Test an Interrupted Purchase
14