Skip to main content

register

Function register 

Source
pub fn register()
Expand description

Installs the StoreKit backend — a no-op on targets without an App Store.

Call it before configure; apps that also run on Android or desktop can call it unconditionally.

Examples found in repository?
examples/link_check.rs (line 18)
17fn main() {
18    cranpose_storekit::register();
19    #[cfg(any(target_os = "ios", target_os = "macos"))]
20    {
21        use cranpose_services::purchases::{self, Purchases};
22        purchases::configure(&["com.example.link.check"]);
23        let backend = cranpose_storekit::StoreKitPurchases;
24        backend.purchase("com.example.link.check");
25        backend.restore();
26        println!("{:?}", purchases::store_state());
27    }
28}