Expand description
StoreKit 2 backend for [cranpose_services::purchases].
StoreKit 2 has no Objective-C surface — Product, Transaction and the
on-device JWS verification are Swift-only — so this crate compiles a small
Swift shim (swift/storekit.swift) in its build script and links it
statically. Apple recommends StoreKit 2 for anything that can require
iOS 15; StoreKit 1 (SKPaymentQueue) is the Objective-C fallback and is
deliberately not used here.
On non-Apple targets the build script is a no-op and every entry point compiles away, so this crate can sit in an Android/Linux/web dependency graph unnoticed.
cranpose_storekit::register();
cranpose_services::purchases::configure(&["com.example.app.pro"]);§Threading
StoreKit answers on Swift concurrency executors, so the Swift shim calls
back from arbitrary threads. All state therefore lives behind a
std::sync::Mutex here, and cranpose_services::purchases::Purchases
reads a clone of it from the UI thread.
Functions§
- register
- Installs the StoreKit backend — a no-op on targets without an App Store.