pushinbr/pam-native-subscriptions

StoreKit 2 and Google Play Billing subscriptions for PAM Native.

Maintainers

Package info

github.com/push-in/pam-native-subscriptions

Language:Kotlin

Type:pam-native-plugin

pkg:composer/pushinbr/pam-native-subscriptions

Transparency log

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-08-01 05:38 UTC

This package is auto-updated.

Last update: 2026-08-01 06:08:47 UTC


README

StoreKit 2 and Google Play Billing subscriptions with products/offers, purchases, pending states, restore, signed JWS or Play purchase tokens, and explicit Play acknowledgement after server verification.

Never grant durable entitlement from the device callback alone. Send verification to your backend, validate it with the App Store Server API or Google Play Developer API, persist the entitlement, then acknowledge Google Play purchases.

Install

composer require pushinbr/pam-native-subscriptions
pam mobile prepare

Configure matching product identifiers in App Store Connect and Google Play Console before querying the catalog.

Load and purchase

use Pam\Native\Subscriptions\Subscriptions;

$subscriptions = new Subscriptions();
$subscriptions->products(['pro.monthly'], function (array $products) use ($subscriptions): void {
    $product = $products[0] ?? null;
    if ($product === null) {
        return;
    }

    $subscriptions->purchase(
        $product->identifier,
        fn ($transaction) => sendToYourBackend($transaction->verification),
        $product->offerToken,
    );
});

The purchase result distinguishes completed, pending, cancelled, and failed states through SubscriptionPurchaseState. Use restore() during account recovery and after sign-in on a new device.