iOS 월간 약정 결제 플랜
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Apple은 월 단위로 청구하되 고객이 12개월의 장기 약정에 동의하는 구독을 지원합니다. StoreKit과 실행 중인 OS가 이 청구 플랜을 지원할 경우, @capgo/native-purchases 가격 조건을 노출하고, 구매 시 월간 결제 플랜을 선택할 수 있으며, 트랜잭션 및 갱신 정보에 커밋 메타데이터를 반환합니다.
사용자는 월 결제를 선호하지만 연간 약정의 유지율과 예측 가능성도 원하는 연간 구독 상품에 이 방식을 사용하세요.
요구 사항
“요구 사항” 섹션- App Store Connect 또는 Xcode의 StoreKit Testing에서 12개월 약정 월간 결제 플랜을 구성하세요.
- StoreKit이 포함된 Xcode SDK로 iOS 앱을 빌드하세요.
pricingTerms및billingPlanType. - StoreKit 약정 결제 플랜을 지원하는 iOS 버전에서 실행하세요.
- 약정 가격 조건을 반환하지 않는 기기나 스토어프런트를 위해 표준 결제 옵션을 유지하세요.
가격 조건 불러오기 및 표시
“가격 조건 불러오기 및 표시” 섹션호출하세요 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 | 가격 조건에 연결되는 도입 또는 프로모션 제공. |
예시 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' 표준 선불 결제 플랜을 명시적으로 선택해야 할 때만 billingPlanType, StoreKit은 해당 제품의 기본 구매 동작을 사용합니다.
약정 메타데이터 읽기
“약정 메타데이터 읽기” 섹션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 를 사용하세요.
App Store 심사 참고 사항
“App Store 심사 노트” 섹션- 구매 전 정기 결제 가격과 총 약정 가격을 모두 표시하세요.
- 구매 버튼 근처에 약정 기간을 명확히 표시하세요.
- 사용
product.title,product.priceString,pricingTerms[].billingDisplayPrice, 그리고pricingTerms[].commitmentInfo.priceStringStoreKit에서 가져온 값으로 하드코딩된 가격 대신 사용하세요. - 페이월 또는 계정 화면에서 구매 복원 및 구독 관리 기능을 제공하세요.
관련 가이드
“관련 가이드” 섹션iOS 월간 약정 결제 플랜에서 계속하기
“iOS 월간 커밋먼트 결제 플랜”에서 계속하기사용 중이라면 iOS 월간 약정 결제 플랜 결제와 구매를 계획하려면 다음을 연결하세요 @capgo/native-purchases 사용하기 @capgo/native-purchases 사용 시 네이티브 기능을 위해, Capgo 가격 Capgo 가격 페이지의 제품 워크플로우, 결제 시스템 결제 시스템의 구현 상세 내용, @capgo/native-purchases @capgo/native-purchases의 구현 상세 내용, 그리고 시작하기 시작하기 페이지의 구현 상세 내용.