feat: add IAP in native bridge plugin for iOS (#1673)

This commit is contained in:
Huang Xin 2025-07-24 20:54:17 +08:00 committed by GitHub
parent beaf034035
commit f3e9983742
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 718 additions and 2 deletions

View file

@ -81,3 +81,34 @@ pub(crate) async fn lock_screen_orientation<R: Runtime>(
) -> Result<()> {
app.native_bridge().lock_screen_orientation(payload)
}
#[command]
pub(crate) async fn iap_initialize<R: Runtime>(
app: AppHandle<R>,
payload: IAPInitializeRequest,
) -> Result<IAPInitializeResponse> {
app.native_bridge().iap_initialize(payload)
}
#[command]
pub(crate) async fn iap_fetch_products<R: Runtime>(
app: AppHandle<R>,
payload: IAPFetchProductsRequest,
) -> Result<IAPFetchProductsResponse> {
app.native_bridge().iap_fetch_products(payload)
}
#[command]
pub(crate) async fn iap_purchase_product<R: Runtime>(
app: AppHandle<R>,
payload: IAPPurchaseProductRequest,
) -> Result<IAPPurchaseProductResponse> {
app.native_bridge().iap_purchase_product(payload)
}
#[command]
pub(crate) async fn iap_restore_purchases<R: Runtime>(
app: AppHandle<R>,
) -> Result<IAPRestorePurchasesResponse> {
app.native_bridge().iap_restore_purchases()
}