내용으로 건너뛰기

iOS 월간 약정 청구 계획

GitHub

애플은 월간 청구를 지원하며 고객을 12개월의 더 긴 약정에 동의합니다. StoreKit 및 실행 중인 OS가 이 청구 계획을 지원할 때, @capgo/native-purchases 청구 가격을 노출하고 구매 시 월간 청구 계획을 선택할 수 있으며 거래 및 갱신 정보에 대한 약정 메타데이터를 반환합니다.

__CAPGO_KEEP_0__를 사용하여 연간 구독 제안을 만들 때, 사용자가 월별 결제를 선호하지만 여전히 연간 약속의 예측 가능성과 유지 보수성을 원할 때 사용합니다.

요구 사항

요구 사항
  • App Store Connect 또는 Xcode의 StoreKit Testing에서 12개월의 약속 결제 플랜을 월별로 구성합니다.
  • iOS 앱을 Xcode SDK로 빌드하여 StoreKit를 포함합니다. pricingTerms iOS 버전에서 StoreKit 약속 결제 플랜을 지원하는 버전에서 실행합니다. billingPlanType.
  • 기본적인 결제 옵션을 유지하여 commitment 가격 제안을 반환하지 않는 장치 또는 매장에 대한 장치에 사용할 수 있습니다.
  • 주의

가격 정보를 불러오고 표시하세요

가격 정보를 불러오고 표시하는 섹션 제목

호출 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__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_3__

__CAPGO_KEEP_4__

__CAPGO_KEEP_5__ billingPlanType: 'monthly'.

const transaction = await NativePurchases.purchaseProduct({
productIdentifier: 'com.example.app.premium.yearly',
productType: PURCHASE_TYPE.SUBS,
billingPlanType: 'monthly',
appAccountToken: userStoreUuid,
});

__CAPGO_KEEP_7__ billingPlanType: 'upFront' __CAPGO_KEEP_8__ billingPlanType__CAPGO_KEEP_9__

약속 메타데이터 읽기

약속 메타데이터 읽기 섹션

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);
}

상위 수준의 expirationDateisActive 권한 결정에 사용하세요. 약속 기간을 고객에게 설명하기 위해 commitmentInfo.expirationDate 를 사용하세요.

앱 스토어 리뷰 노트

앱 스토어 리뷰 노트 섹션
  • 구매 전에 반복 결제 가격과 총 약정 가격을 모두 표시합니다.
  • 구매 버튼 근처에서 약정 기간을 명확히 표시합니다.
  • StoreKit에서 hardcoded 가격 대신 "", "", ""를 사용합니다. product.title, product.priceString, pricingTerms[].billingDisplayPrice구매 페이지 또는 계정 화면에서 구독 복원 및 관리 액션을 제공합니다. pricingTerms[].commitmentInfo.priceString 관련 문서
  • 관련 문서 섹션

iOS 월간 약정 요금 계획에서 계속

iOS 월간 약정 요금 계획에서 계속하는 부분

iOS 월간 약정 요금 계획을 사용 중이라면 iOS 월간 약정 요금 계획 __CAPGO_KEEP_0__/native-purchases를 사용하여 capgo/native-purchases의 네이티브 기능을 위해 capgo 가격 정보 Capgo 가격 정보의 제품 워크플로우 for the product workflow in Capgo Pricing, 결제 시스템의 구현 세부 사항']} (Note: The translation is based on the assumption that the target language is Korean.) The translation is done in a way that it is natural for the user cultural context and adapts idioms, grammar, tone, and phrasing instead of translating word for word. The protected tokens are preserved as they are. The placeholders are copied exactly as written. The translation is in the same order as the input. The result is a JSON object with exactly one key named translations @capgo/native-purchases for the implementation detail in @capgo/native-purchases, and Getting Started Getting Started 시작