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 4)
3fn main() {
4    cranpose_storekit::register();
5    #[cfg(any(target_os = "ios", target_os = "macos"))]
6    {
7        use cranpose_services::purchases::{self, Purchases};
8        purchases::configure(&["com.example.link.check"]);
9        let backend = cranpose_storekit::StoreKitPurchases;
10        backend.purchase("com.example.link.check");
11        backend.restore();
12        println!("{:?}", purchases::store_state());
13    }
14}