PAM Native Background Transfer
Start here
Section titled “Start here”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:
curl -fsSL https://github.com/push-in/pam/releases/latest/download/install.sh | shpam doctorpam init my-app --template nativecd my-apppam composer require pushinbr/pam-native-background-transferpam doctorpam native dev$transfers = new Pam\Native\BackgroundTransfer\BackgroundTransfer();$transfers->download( 'https://cdn.example.com/movie.mp4', 'media/movie.mp4', function (?string $id, ?string $error): void { // Persist the ID and reconcile it after relaunch. },);BackgroundTransfer creates uploads/downloads and queries durable work;
TransferSnapshot exposes progress, state, and errors. NetworkRequirement
selects connected, unmetered, or not-roaming, while TransferState and
TransferKind are integer-backed lifecycle enums.
Transfers require HTTPS and sandbox-relative paths; native code rejects
traversal. Android WorkManager retries transient failures up to three times;
iOS uses a launch-event-enabled background URLSession. Persist IDs before the
initiating screen disappears, reconcile them after launch/resume, and validate
downloaded size, type, and checksum before trust.
Support: PAM Native 0.6.x, Android API 26+, iOS 15+.
Public types: BackgroundTransfer, TransferSnapshot, TransferKind,
TransferState, NetworkRequirement, and the auto-discovered
BackgroundTransferPluginProvider.