Presentation
Public surface (presentation):
get · getEvents · getDeviceEvents · reload · close ·
getAll · getByID · getByName · refresh · download ·
openByID · openByExternalID · openByName · openPicker
Current presentation
Section titled “Current presentation”get(): Promise<Presentation>getEvents(): Promise<unknown[]>getDeviceEvents(): Promise<unknown[]> // alias of getEventsreload(): voidclose(): void // logs analytics event method 'close-presentation'import mobilelocker from '@mobilelocker/javascript-sdk'
const presentation = await mobilelocker.presentation.get()const events = await mobilelocker.presentation.getEvents()
mobilelocker.presentation.reload()mobilelocker.presentation.close()Session-scoped device events: session.getDeviceEvents.
Library
Section titled “Library”getAll(): Promise<Presentation[]>getByID(id: number): Promise<Presentation>getByName(name: string): Promise<Presentation> // case-sensitiverefresh(): Promise<Presentation[]>const all = await mobilelocker.presentation.getAll()const byId = await mobilelocker.presentation.getByID(id)const byName = await mobilelocker.presentation.getByName(name)const refreshed = await mobilelocker.presentation.refresh()Download
Section titled “Download”download(id: number): Promise<DownloadResult>// DownloadResult = WithStatusBooleans<{ status: DownloadStatus }>// DownloadStatus = 'queued' | 'already_installed' | 'not_available' | 'not_permitted'// booleans: isQueued, isAlreadyInstalled, isNotAvailable, isNotPermittedconst result = await mobilelocker.presentation.download(presentationID)if (result.isQueued || result.status === 'queued') { // download started}openByID(id: number): voidopenByExternalID(externalID: string): Promise<void>openByName(name: string): Promise<void>openPicker(): void // iOS only — throws UnsupportedEnvironment elsewhere| Method | iOS | Browser / non-iOS |
|---|---|---|
openByID |
Host open | window.open web content URL |
openByExternalID / openByName |
Host open | Resolve via getAll(), then openByID; throws NotFound if missing |
openPicker |
Native picker | Throws |
mobilelocker.presentation.openByID(42)await mobilelocker.presentation.openByName('Kazaamax Rebate Calculator Demo')await mobilelocker.presentation.openByExternalID('a0B1234567890')
if (mobilelocker.isIOS()) { mobilelocker.presentation.openPicker()}API reference
Section titled “API reference”- Module:
presentation - Types:
Presentation,DownloadResult,DownloadStatus