iOS 월간 약정 청구 계획
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 프롬프트 복사
애플은 월간 청구를 지원하는 구독을 제공하며 고객을 12개월의 더 긴 기간에 동의합니다. StoreKit 및 실행 중인 OS가 이 청구 계획을 지원할 때, @capgo/native-purchases 청구 기간, 구매 시 월간 청구 계획을 선택할 수 있도록 가격 조건을 노출하고, 거래 및 갱신 정보에 대한 의무 메타데이터를 반환합니다.
월간 청구를 선호하는 사용자가 여전히 연간 계약의 유지를 원하는 경우 연간 구독 제안에 사용하세요.
요구 사항
“요구 사항”이라는 제목을 가진 섹션- App Store Connect 또는 Xcode의 StoreKit Testing에서 12개월 계약 billing 계획을 설정하세요.
- Build the iOS app with an Xcode SDK that contains StoreKit
pricingTermsRun on an iOS version that supports StoreKit commitment billing plans.billingPlanType. - 기본적인 billing 옵션을 유지하세요. commitment 가격 조건을 반환하지 않는 장치 또는 스토어 하우스에 대해.
- Note
Section titled “가격 조건을 로드하고 표시하세요.”
CallLoad and Display Pricing Terms 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',);스토어에서 제공하는 값을 고정된 가격 대신 렌더링합니다.
| Field | 이를 사용하여 |
|---|---|
billingDisplayPrice | 사용자에게 표시되는 반복 청구 금액, 예를 들어 월별 요금 |
billingPeriod | 표시되는 청구 가격의 청구 주기 |
commitmentInfo.priceString | 사용자 상점에 맞게 형식화된 총 청구 기간 |
commitmentInfo.period | 청구 기간 |
subscriptionOffers | 가격 조건에 첨부된 소개 또는 프로모션 제안 |
예시 paywall 복사본:
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' 표준 전면 요금 청구 플랜을 명시적으로 선택해야 할 때만 사용하세요. 만약 생략하면 billingPlanTypeStoreKit은 제품에 대한 기본 구매 동작을 사용합니다.
의무 계약 메타데이터를 읽어보세요
Section titled “Commitment Metadata Read”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 앱 스토어 리뷰 노트
Section titled “App Store Review Notes”
구독 가격과 전체 약속 가격을 구매 전에 표시하세요.- App Store Review Notes
- 구매 버튼 근처에서 약정 기간을 명확히 하세요.
- StoreKit을 사용하여 "", "" 대신 고정 가격을 사용하세요.
product.title,product.priceString,pricingTerms[].billingDisplayPrice구매 복원 및 구독 관리 액션을 결제墙 또는 계정 화면에 제공하세요.pricingTerms[].commitmentInfo.priceString관련 가이드 - 관련 가이드 섹션
iOS 구독 만들기
iOS 샌드박스 테스트 구성__CAPGO_KEEP_0__
__CAPGO_KEEP_0__만약에 __CAPGO_KEEP_0__을 사용하고 있다면 iOS 월간 약속 청구 요금 계획 결제와 구매를 계획하기 위해, __CAPGO_KEEP_0__과 연결하세요. Using @capgo/native-purchases capgo/native-purchases의 네이티브 기능을 위해 @capgo/native-purchases을 사용하세요. Capgo Pricing Capgo Pricing의 제품 워크플로우를 위해 Capgo Pricing을 사용하세요. Payment system Payment system의 구현 세부 정보를 위해 @capgo/native-purchases @capgo/native-purchases의 구현 세부 정보를 위해 @capgo/native-purchases을 사용하세요. Getting Started Getting Started에 대한 구현 세부 정보를 위해.