iOS 月額コミット請求計画
__CAPGO_KEEP_3__
__CAPGO_KEEP_10__ @capgo/native-purchases __CAPGO_KEEP_11__
年間サブスクリプションのオファーで、ユーザーが月額支払いを好むが、コミットメントされた年間契約の予測可能性と保持を望む場合に使用してください。
- App Store ConnectまたはXcodeのStoreKit Testingで、月額12か月のコミットメント請求計画をStoreKitで設定してください。
- XcodeのSDKでiOSアプリをビルドし、StoreKitを含みます。
pricingTermsiOSバージョンで実行してください。StoreKitコミットメント請求計画をサポートするバージョンです。billingPlanType. - 標準の請求オプションを保持してください。コミットメント価格条件を返さないデバイスまたはストアフロントのために。
- 注記
料金表示の読み込み
料金表示の読み込みセクション電話 getProducts() 通常通り。サポートされているiOSサブスクリプション製品の場合、各製品には pricingTerms.
import { NativePurchases, PURCHASE_TYPE } from '@capgo/native-purchases';
const { products } = await NativePurchases.getProducts({ productIdentifiers: ['com.example.app.premium.yearly'], productType: PURCHASE_TYPE.SUBS,});
const premiumYearly = products.find( (product) => product.identifier === 'com.example.app.premium.yearly',);const monthlyCommitment = premiumYearly?.pricingTerms?.find( (term) => term.billingPlanType === 'monthly',);ストアから提供された値をハードコードされた価格の代わりに表示する
| フィールド | 使用する |
|---|---|
billingDisplayPrice | ユーザーに表示される繰り返し請求金額、例えば月額料金 |
billingPeriod | 表示される請求価格の請求サイクル |
commitmentInfo.priceString | ユーザーのストアフロントに適切にフォーマットされた合計コミットメント価格 |
commitmentInfo.period | 完全なコミットメント期間 |
subscriptionOffers | __CAPGO_KEEP_0__の価格条件に付随する紹介的または宣伝的オファーです。 |
__CAPGO_KEEP_1__の例のパイウォールコピー:
function commitmentLabel(term: NonNullable<typeof monthlyCommitment>) { const total = term.commitmentInfo?.priceString; return total ? `${term.billingDisplayPrice} billed monthly, ${total} total commitment` : term.billingDisplayPrice;}月額コミットメントプランを購入
__CAPGO_KEEP_2__の「月額コミットメントプランを購入」セクション月額コミットメントプランを選択したときに billingPlanType: 'monthly'.
const transaction = await NativePurchases.purchaseProduct({ productIdentifier: 'com.example.app.premium.yearly', productType: PURCHASE_TYPE.SUBS, billingPlanType: 'monthly', appAccountToken: userStoreUuid,});使用 billingPlanType: 'upFront' 標準の前払い請求計画を明示的に選択する必要がある場合のみ使用してください。__CAPGO_KEEP_0__を省略すると billingPlanTypeStoreKitはデフォルトの購入動作を使用します。
コミットメントメタデータを読む
セクションのタイトルは「コミットメントメタデータを読む」StoreKitが提供する場合の請求計画とコミットメント進捗が含まれるトランザクションは次のようになります:
if (transaction.billingPlanType === 'monthly') { console.log('Current billing period:', transaction.commitmentInfo?.billingPeriodNumber); console.log('Total billing periods:', transaction.commitmentInfo?.totalBillingPeriods); console.log('Commitment ends:', transaction.commitmentInfo?.expirationDate); console.log('Commitment total:', transaction.commitmentInfo?.price);}再契約情報には次のコミットメント状態が含まれることがあります:
const { purchases } = await NativePurchases.getPurchases({ productType: PURCHASE_TYPE.SUBS, onlyCurrentEntitlements: true,});
for (const purchase of purchases) { const commitment = purchase.renewalInfo?.commitmentInfo; if (!commitment) continue;
console.log('Renews into another commitment:', commitment.willAutoRenew); console.log('Next billing plan:', commitment.renewalBillingPlanType); console.log('Next renewal date:', commitment.renewalDate);}トップレベルの expirationDate とフィールドを利用してエンタイトルメントの決定を行います。 isActive を利用して、コミットメントのフルタイムラインを顧客に説明します。 commitmentInfo.expirationDate __CAPGO_KEEP_1__
App Store レビュー ノート
「App Store レビュー ノート」セクション- 購入前に、定期課金価格と合計コミットメント価格を両方表示します。
- 購入ボタン近くでコミットメント期間を明確に表示します。
- 「」、「」、「」から StoreKit を使用するのではなく、ハードコードされた価格を使用します。
product.title,product.priceString,pricingTerms[].billingDisplayPrice購入画面またはアカウント画面で復元購入とサブスクリプション管理アクションを提供します。pricingTerms[].commitmentInfo.priceString関連ガイド - 「関連ガイド」セクション
iOS サブスクリプションの作成
iOS サンドボックス テストの設定iOS 月額コミットメント請求プランから続けて
「iOS 月額コミットメント請求プランから続けて」セクションCapgoを使用している場合 iOS 月額コミットメント請求プラン 支払いと購入を計画するために使用する場合、Capgoのnative-purchasesを Capgoのnative-purchasesのnative機能を使用する場合、@capgo/native-purchases capgo Pricing Capgo Pricing for the product workflow in Capgo Pricing, 支払いシステムの実装詳細 iOS App Store レビュー ガイドライン @capgo/native-purchases @capgo/native-purchasesの実装詳細について Getting Started Getting Startedの実装詳細について