Apple App Store Server Rust Library
The Rust server library for the App Store Server API and App Store Server Notifications
Installation
Specify app-store-server-library
in your project's Cargo.toml
file, under the [dependencies]
section:
-store-server-library =
app
Check crates.io for the latest version number.
Usage
API Usage
use ;
async
Note: To extract transaction id from app/tx receipt,
api-client
feature must be enabled.
Verification Usage
// .unwrap() used for example purposes only
let root_cert = "apple-root-cert-in-base-base64-format"; // https://www.apple.com/certificateauthority/AppleRootCA-G3.cer
let root_cert_der = root_cert.as_der_bytes.unwrap; // Use `base64` crate to decode base64 string into bytes
let verifier = new;
let payload = "signed-payload";
let decoded_payload = verifier.verify_and_decode_notification.unwrap;
Receipt Usage
let receipt = "MI..";
let transaction_id = extract_transaction_id_from_app_receipt;
Note: To extract transaction id from app/tx receipt,
receipt-utility
feature must be enabled.
Promotional Offer Signature Creation
// .unwrap() used for example purposes only
let private_key = include_str!;
let creator = new.unwrap;
let signature: String = creator.create_signature.unwrap;
Documentation
- The full documentation is available at docs.rs
- WWDC Video