내용으로 건너뛰기

iOS 월간 약정 청구 계획

GitHub

애플은 월별로 청구하는 구독을 지원하며 고객을 더 긴 12개월의 약속에 묶습니다. StoreKit과 실행 중인 OS가 이 청구 계획을 지원할 때, @capgo/native-purchases 가격 정보를 공개하고 구매 시 월별 청구 계획을 선택할 수 있으며 거래와 갱신 정보의 약속 메타데이터를 반환합니다.

월별 결제를 선호하는 사용자들이라도 여전히 연간 약속의 보유와 예측 가능성을 원하는 경우에 이 옵션을 사용하세요.

  • iOS 앱을 Xcode __CAPGO_KEEP_0__로 빌드하여 StoreKit을 포함하고,
  • Build the iOS app with an Xcode SDK that contains StoreKit pricingTerms Commitment 가격 정보를 반환하지 않는 장치 또는 스토어 하우스에 대해 표준 청구 옵션을 유지하세요. 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__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;
}

__CAPGO_KEEP_5__

__CAPGO_KEEP_6__

월간 약정 플랜을 구매하세요 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판매促인

약정 메타데이터 읽기

약정 메타데이터 읽기 섹션

거래에는 StoreKit이 제공하는 billing plan과 약정 진행 상황이 포함됩니다.

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 __CAPGO_KEEP_2__와 isActive 권한 부여 결정을 위한 field입니다. commitmentInfo.expirationDate 고객에게 전체 약속 기간을 설명하세요.

앱 스토어 리뷰 노트

앱 스토어 리뷰 노트
  • 구매 전에 반복 청구 가격과 총 약속 가격을 모두 표시하세요.
  • 구매 버튼 근처에서 약속 기간을 명확하게 표시하세요.
  • StoreKit에서 고정된 가격 대신 product.title, product.priceString, pricingTerms[].billingDisplayPrice, pricingTerms[].commitmentInfo.priceString 결제 벽 또는 계정 화면에서 구입을 복원하고 구독 관리 액션을 제공하세요.
  • 관련 가이드

iOS 월간 약정 청구 계획에서 계속

iOS 월간 약정 청구 계획에서 계속 제목

이용 중이라면 iOS 월간 약정 청구 계획 결제 및 구매를 계획하고 싶다면 Using @capgo/native-purchases Using @capgo/native-purchases에서 native capability Capgo Pricing Capgo Pricing에서 product workflow 결제 시스템 결제 시스템 구현 세부 정보에 대해 @capgo/native-purchases @capgo/native-purchases 구현 세부 정보에 대해, Getting Started Getting Started 구현 세부 정보에 대해.