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