Skip to content

Presentation

Public surface (presentation):
get · getEvents · getDeviceEvents · reload · close ·
getAll · getByID · getByName · refresh · download ·
openByID · openByExternalID · openByName · openPicker

get(): Promise<Presentation>
getEvents(): Promise<unknown[]>
getDeviceEvents(): Promise<unknown[]> // alias of getEvents
reload(): void
close(): 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.

getAll(): Promise<Presentation[]>
getByID(id: number): Promise<Presentation>
getByName(name: string): Promise<Presentation> // case-sensitive
refresh(): 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(id: number): Promise<DownloadResult>
// DownloadResult = WithStatusBooleans<{ status: DownloadStatus }>
// DownloadStatus = 'queued' | 'already_installed' | 'not_available' | 'not_permitted'
// booleans: isQueued, isAlreadyInstalled, isNotAvailable, isNotPermitted
const result = await mobilelocker.presentation.download(presentationID)
if (result.isQueued || result.status === 'queued') {
// download started
}
openByID(id: number): void
openByExternalID(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()
}