アプリ内課金の実装
#モバイルアプリ開発
#FlutterFlow #RevenueCat
基本的な設定の流れ
FlutterFlow
https://blog.flutterflow.io/in-app-subscriptions-using-revenue-cat/
iOSでSubscriptionグループとプランの設定を行う
Androidで、定期購入の設定を行う
revenuecatを有効にしたアプリを事前にアップロードしないと設定できない。
トラブルシューティング
https://www.revenuecat.com/docs/offerings/troubleshooting-offerings
Bundle IDが一致しているか
Product IDが一致しているか
Appleのサブスクリプションのステータスが審査準備完了の状態になっているか
原因は、サブスクリプションのステータスと、OfferingにProductが設定されていなかった。
https://developer.apple.com/documentation/storekit/testing-in-app-purchases-with-sandbox
----
Store Connectの設定
App Store Connect App-Specific Shared Secret
https://www.revenuecat.com/docs/service-credentials/itunesconnect-app-specific-shared-secret
非推奨
In-App Purchase Key Configuration の設定を行う。
https://www.revenuecat.com/docs/service-credentials/itunesconnect-app-specific-shared-secret/in-app-purchase-key-configuration
アプリ内課金で、鍵を作成、出力する
それを、revenuecatのiOSプロジェクトに設定する。
App Store Connect API Key Configuration
https://www.revenuecat.com/docs/service-credentials/itunesconnect-app-specific-shared-secret/app-store-connect-api-key-configuration
store connectの課金設定をインポートするために設定する。
App Store Connect APIで、鍵を作成
App Managerに設定しておく
同様にrevenuecatのiOSプロジェクトに設定する。
税金カテゴリ
カテゴリ:App Storeソフトウェア
https://developer.apple.com/jp/help/app-store-connect/manage-app-information/set-a-tax-category/
税務情報の提供
https://developer.apple.com/jp/help/app-store-connect/manage-tax-information/provide-tax-information/
米国に拠点を置かないデベロッパーは該当する証明書が必要なよう
----
PlayConsole
https://www.revenuecat.com/docs/service-credentials/creating-play-service-credentials
GCPの設定
以下をEnableにする
Google Play Android Developer API
Google Play Developer Reporting API
Service accountを作成
以下のRoleをGrant
Pub/Sub Editor
Monitoring Viewer
private key (json)を作成する
get a head start on setting up Google real-time developer notifications by ensuring Google Cloud Pub/Sub is enabled for your project.
https://console.cloud.google.com/flows/enableapi?apiid=pubsub
アプリ情報の閲覧、一括レポートのダウンロード(読み取り専用)
売上データ、注文、解約アンケートの回答の閲覧
注文と定期購入の管理
Google Real-Time Developer Notifications
https://www.revenuecat.com/docs/platform-resources/server-notifications/google-server-notifications
これもやった方が良いみたい
定期購入の設定
https://support.google.com/googleplay/android-developer/answer/12154973?sjid=5005931922721278601-NC
クラウド ストレージ アプリで 100 GB、1 TB、10 TB の定期購入を用意する)。
プラン分けする場合も、定期購入を複数用意すれば良さそう。
共通設定
RevenueCat
Offerに複数の同じサブスク期間のパッケージを追加するには、
a custom identifierで追加する。
https://community.revenuecat.com/dashboard-tools-52/how-to-add-2-annual-products-to-annual-package-in-an-offering-1867
Revenuecat keyの設定
iOS, Ancroidプロジェクトのそれぞれのpublic keyを、FlutterFlowのRevenuecat keysに設定する
iOSのテスト
Sandboxモードにする必要がある
Sandbox
iOSの設定
https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#ios-14-only-testing-on-the-simulator?utm_medium=referral&utm_source=techp&utm_campaign=flutterflow&utm_content=partner
iPhoneの設定
https://developer.apple.com/documentation/storekit/testing-in-app-purchases-with-sandbox
developer modeをオンにしておく
Settings → Select Media & Purchases
On the pop-up menu, select Sign Out.
open Settings and select Developer.
Scroll to the bottom of the screen, and select Sign In under Sandbox Apple Account. Enter your Sandbox Apple Account credentials.
amserrordomain error 2 testflight
のエラーが発生
以下が原因と思われる
https://community.revenuecat.com/sdks-51/why-are-offerings-or-products-empty-124
TestFlightは既にSandbox環境となっている。
iOSの設定でSandboxアカウントでログインすれば、自動的にSandboxアカウントでアプリを利用できる。
TestFightのアプリは、本アカウントでインストールする必要がある。
---
サブスクリプションの管理を行うには
iOSの設定→ Sandboxアカウント→管理
参考
自動更新サブスクリプション
https://developer.apple.com/jp/app-store/subscriptions/
【ノーコード】FlutterFlowでアプリ内課金・サブスクリプションを実装しよう
https://citrusapp.jp/posts/flutterflow-in-app-purchase-subscription-revenucat
Firebaseを使ったサービスでStripeとRevenueCatを共存させる
https://zenn.dev/flutteruniv_dev/articles/730ac2021daf34
チェック
参考
https://qiita.com/ckm/items/b8cf23ba4bd0ae5bbf34