跳过主要内容
返回插件
@revenuecat/purchases-capacitor
教程
@revenuecat/purchases-capacitor

订阅

使用RevenueCat SDK实现跨平台的订阅和购买功能

{"targetLanguage":"Simplified Chinese"}

{"protectedTokens":["Cloudflare","Capacitor","GitHub","Capgo","code","API","SDK","CLI","npm","bun"]}

Using @revenuecat/purchases-capacitor

"","使用@revenuecat/purchases-Capacitor","Capacitor轻松实现iOS和Android的内购和订阅功能。支持iOS和Android。","","","","- 使用Capacitor密钥和应用用户ID设置Purchases。 - 获取当前订阅者的虚拟货币。 - invalidates虚拟货币缓存。 - 获取当前缓存的虚拟货币。如果有缓存,值为null,直到至少使用或等效函数获取虚拟货币为止。 ","","使用Capacitor密钥和应用用户ID设置Purchases。"]}

{"targetLanguage":"Simplified Chinese"}

bun add @revenuecat/purchases-capacitor
bunx cap sync

{"protectedTokens":["Cloudflare","Capacitor","GitHub","Capgo","code","API","SDK","CLI","npm","bun"]}

  • configure - Sets up Purchases with your API key and an app user id.
  • getVirtualCurrencies "",""
  • invalidateVirtualCurrenciesCache "",""
  • getCachedVirtualCurrencies "",""

"",""

configure

Sets up Purchases with your API key and an app user id.

import { Purchases } from '@revenuecat/purchases-capacitor';

await Purchases.configure({} as PurchasesConfiguration);

getVirtualCurrencies

获取当前订阅者的虚拟货币。

import { Purchases } from '@revenuecat/purchases-capacitor';

await Purchases.getVirtualCurrencies();

invalidateVirtualCurrenciesCache

Invalidates the cache for virtual currencies.

import { Purchases } from '@revenuecat/purchases-capacitor';

await Purchases.invalidateVirtualCurrenciesCache();

getCachedVirtualCurrencies

当前缓存的虚拟货币值,如果有的话。这一值将保持为 null,直到至少使用 fetchVirtualCurrencies() 或等效函数获取虚拟货币值为止。

import { Purchases } from '@revenuecat/purchases-capacitor';

await Purchases.getCachedVirtualCurrencies();

全局参考

继续使用 @revenuecat/purchases-capacitor

如果您正在使用 使用 @revenuecat/purchases-capacitor 来规划付款和购买,连接它与 Capgo Pricing 为 Capgo Pricing 中的产品工作流程。 支付系统 支付系统的实现细节 @capgo/native-purchases @capgo/native-purchases的实现细节 开始使用 开始使用的实现细节 营收手册 营收手册的实现细节