Skip to content

PAM Native Subscriptions

Every PAM Native product runs on the PAM runtime. Install and verify PAM first, create a Native application, and add this package through PAM Composer:

Terminal window
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | sh
pam doctor
pam init my-app --template native
cd my-app
pam composer require pushinbr/pam-native-subscriptions
pam doctor
pam native dev
$subscriptions = new Subscriptions();
$subscriptions->products(['pro.monthly'], function (array $products) use ($subscriptions): void {
if (($product = $products[0] ?? null) === null) return;
$subscriptions->purchase(
$product->identifier,
fn ($transaction) => sendToBackend($transaction->verification),
$product->offerToken,
);
});

Subscriptions loads products, purchases, restores, and acknowledges; SubscriptionProduct normalizes price/offers; SubscriptionTransaction carries JWS/Play verification material; SubscriptionPurchaseState separates completed, pending, cancelled, and failed.

Verify every transaction through App Store Server or Google Play Developer API, persist entitlement server-side, then acknowledge Play. Never grant durable entitlement from a device callback. Reconcile after sign-in and account restore.

SubscriptionsPluginProvider registers the store module automatically.