iOS 월간 의무 청구 계획
복사하기
애플은 12개월 기간 동안 고객을 더 긴 12개월 기간에 대한 약속으로 청구하는 월간 구독을 지원합니다. StoreKit과 실행 중인 OS가 이 청구 계획을 지원할 때, @capgo/native-purchases StoreKit이 가격 조건을 노출하고 구매 시 월간 청구 계획을 선택할 수 있도록하고, 거래 및 갱신 정보에 대한 약속 메타데이터를 반환합니다.
년간 구독 제안을 위해 사용하세요. 사용자가 월간 결제를 선호하지만 여전히 연간 약속과 예측 가능성을 유지하고 싶은 경우.
요구 사항
요구 사항- App Store Connect 또는 Xcode의 StoreKit 테스트에서 12개월 약속 월간 청구 계획을 구성하세요.
- StoreKit이 포함된 Xcode SDK로 iOS 앱을 빌드하세요.
pricingTermsStoreKit 약속 청구 계획을 지원하는 iOS 버전에서 실행하세요.billingPlanType. - StoreKit 약속 청구 계획을 지원하지 않는 기기 또는 스토어 하우스에 대해 표준 청구 옵션을 유지하세요.
- 주의
가격 정보를 로드하고 표시하세요.
제목 "가격 정보를 로드하고 표시하세요."Call 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 | __CAPGO_KEEP_0__ |
commitmentInfo.period | __CAPGO_KEEP_1__ |
subscriptionOffers | __CAPGO_KEEP_2__ |
__CAPGO_KEEP_3__
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' 만약 표준 일시불 결제 플랜을 선택하지 않으면, StoreKit은 제품에 대한 기본 구매 동작을 사용합니다. billingPlanType__CAPGO_KEEP_6__
약속 메타데이터 읽기
약속 메타데이터 읽기 섹션스토어 키트에서 제공하는 경우 거래에는 청구 계획과 약속 진행도가 포함됩니다:
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 구독 승인에 필요한 field입니다. 사용 commitmentInfo.expirationDate 구독 기간을 고객에게 설명하기 위해
애플 스토어 리뷰 노트
애플 스토어 리뷰 노트- 구독 가격과 총 구독 기간을 구매하기 전에 보여주세요.
- 구독 기간을 구매 버튼 근처에 명확하게 표시하세요.
- 사용
product.title,product.priceString,pricingTerms[].billingDisplayPrice, 그리고pricingTerms[].commitmentInfo.priceStringStoreKit에서 hardcoded 가격 대신 가격을 가져옵니다. - 구독을 복원하고 구독 관리 액션을 결제 화면 또는 계정 화면에서 제공하세요.
관련 문서
관련 문서iOS 월간 약속 결제 계획에서 계속 진행
iOS 월간 약속 결제 계획에서 계속 진행iOS 월간 약속 결제 계획을 사용 중이라면 iOS 월간 약속 결제 계획 iOS 월간 약속 결제 계획과 함께 연결 Using @capgo/native-purchases Using @capgo/native-purchases Capgo 가격 정보 Capgo 가격 정보 결제 시스템 결제 시스템의 구현 세부 사항에 대해 @capgo/native-purchases @capgo/native-purchases의 구현 세부 사항에 대해, 그리고 시작하기 시작하기의 구현 세부 사항에 대해