メインコンテンツにスキップ

iOS 月額コミット請求計画

GitHub

__CAPGO_KEEP_10__ @capgo/native-purchases __CAPGO_KEEP_11__

年間サブスクリプションのオファーで、ユーザーが月額支払いを好むが、コミットメントされた年間契約の予測可能性と保持を望む場合に使用してください。

  • App Store ConnectまたはXcodeのStoreKit Testingで、月額12か月のコミットメント請求計画をStoreKitで設定してください。
  • XcodeのSDKでiOSアプリをビルドし、StoreKitを含みます。 pricingTerms iOSバージョンで実行してください。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;
}

月額コミットメントプランを選択したときに 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__

  • 購入前に、定期課金価格と合計コミットメント価格を両方表示します。
  • 購入ボタン近くでコミットメント期間を明確に表示します。
  • 「」、「」、「」から StoreKit を使用するのではなく、ハードコードされた価格を使用します。 product.title, product.priceString, pricingTerms[].billingDisplayPrice購入画面またはアカウント画面で復元購入とサブスクリプション管理アクションを提供します。 pricingTerms[].commitmentInfo.priceString 関連ガイド
  • 「関連ガイド」セクション
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の実装詳細について