AppleStoreSource

class AppleStoreSource(store: ApplePackStore, dispatcher: CoroutineDispatcher = Dispatchers.Default) : PackSource(source)

Apple's stores through the app's Swift adapter: Apple-hosted packs on iOS 26 and later, On-Demand Resources on iOS 17 and 18. Callbacks may arrive on any thread; each call resumes once, and file bytes are copied out of NSData on dispatcher straight away.

Constructors

Link copied to clipboard
constructor(store: ApplePackStore, dispatcher: CoroutineDispatcher = Dispatchers.Default)

Functions

Link copied to clipboard
open suspend override fun fetch(packId: String): PackState

Starts or resumes the download and suspends until the state isSettled. Cancelling cancels the download.

Link copied to clipboard
open suspend override fun readBytes(packId: String, path: String): ByteArray?

A file of a ready pack, or null when the pack is not ready or has no such file.

Link copied to clipboard
open suspend override fun remove(packId: String)

Frees the pack's space; the next fetch downloads it again.

Link copied to clipboard
open override fun state(packId: String): Flow<PackState>

The first value in a process comes from the store; after that, from this source's own fetches.