API Reference

Registration schema

exports['amzn_smartphone']:registerApp({
    id          = 'myapp',       -- required, [a-z0-9_], max 32 chars
    label       = 'My App',      -- required, display name
    icon        = 'fa-star',     -- required, Font Awesome solid icon
    color       = '#0a84ff',     -- required, hex or CSS gradient
    category    = 'appstore',    -- 'appstore' | 'default'
    ui          = 'web/index.html', -- required, path in your resource files
    description = '',            -- optional, App Store text
    version     = '1.0.0',       -- optional
    developer   = 'My Server',   -- optional
})

Returns ok, reason on failure (reserved_id, ui_missing, default_not_allowed, etc.).

Category rules

Category Behavior
appstore Appears in App Store; must be installed by the player
default Always visible on home screen; requires Config.AllowedDefaultApps[ id ] = true

Built-in app ids cannot be reused.


Injected iframe globals

Provided by 919phone-sdk.js:

Global Description
resourceName Registering resource name
appName Registered app id
settings Phone settings snapshot (theme, brightness, volume)
fetchNui(event, data) Call your resource's RegisterNUICallback handlers
onNuiEvent(type, callback) Listen for phone → app push messages
onSettingsChange(callback) Fired when phone settings change while app is open

fetchNui

const result = await fetchNui('getData', { page: 1 })
await fetchNui('save', payload)

Flow:

  1. iframe posts to phone shell
  2. phone validates the app is currently open
  3. phone calls https://{registering_resource}/{event} against your RegisterNUICallback
  4. response resolves the promise

Requests and responses are limited by Config.Sdk.MaxFetchPayload.


sendAppMessage / onNuiEvent

Client export

exports['amzn_smartphone']:sendAppMessage(appId, type, data)

Server export

exports['amzn_smartphone']:sendAppMessage(source, appId, type, data)

Only the resource that registered the app can send messages for that app.

UI listener

onNuiEvent('refresh', (data) => { ... })
onNuiEvent('route', (params) => { ... })

If Config.Sdk.QueueMessagesWhenClosed = true, the latest message per app is delivered on next open.


unregisterApp

exports['amzn_smartphone']:unregisterApp('myapp')

Only the registering resource can unregister its own app. Apps are also removed automatically on resource stop.


Config

See Config.Sdk and Config.AllowedDefaultApps in Configuration.

919DESIGN 919DESIGN

© 2026 919DESIGN. Premium FiveM Server Management Resources.

This website and its checkout process is owned & operated by Tebex Limited, who handle product fulfilment, billing support and refunds.