QS Smartphone — Developer API
Short reference for integrating external resources with qs-smartphone.
All exports use the resource name:
Starter Templates
Quasar Smartphone includes starter templates to help developers quickly create custom applications.
Available templates:
These templates already include the recommended structure for iframe communication, UI integration and smartphone bridge compatibility.
Third-Party App Ecosystem
Build and integrate fully custom smartphone applications directly into Quasar Smartphone using React, jQuery or any modern web framework with iframe support and bridge communication.
Create immersive applications, App Store experiences, external interfaces and advanced integrations fully connected with the smartphone ecosystem.
Creating A Custom App
Custom applications must be registered from the client side after qs-smartphone has fully started.
Example:
Application Structure
| Field | Description |
|---|---|
id | Unique internal application identifier |
label | Visible application name inside the smartphone |
icon | Application icon URL |
category | App Store category |
creator | Developer or creator name |
description | Description shown inside the App Store |
appStoreOnly | true = downloadable app, false = pre-installed |
sizeMb | Simulated application size shown in the App Store |
iframe.url | URL loaded inside the smartphone iframe |
custom.enabled | Enables custom iframe functionality |
bridge.enabled | Enables communication bridge |
allowedOrigins | Allowed iframe origins for secure communication |
Custom App Exports
| Export | Description |
|---|---|
addCustomApp(payload) | Register a single application |
addCustomAppsBatch(payloads) | Register multiple applications at once |
updateCustomApp(appId, patch) | Update fields from an existing application |
removeCustomApp(appId) | Remove an application by id |
getCustomApps() | Returns all registered applications |
Applications are automatically removed when the owner resource stops.
Built-in native applications such as:
and other internal smartphone apps are excluded from automatic removal.
Push Notification Server
Send lock-screen or banner notifications directly to a player phone.
The player must have an active phone scope before receiving scoped notifications.
You can also send a notification directly using the player server ID:
Returns:
Common errors include:
Phone Number And Scope
Use these server exports to get the player phone identity.
| Export | Description |
|---|---|
getPhoneScopeIdentifier(source) | Returns the persistent phone scope used for notifications and data isolation |
GetCurrentPhoneNumber(source) | Returns the active SIM or metadata phone number for the player |
Check If Phone Is Open
Use this client export to check if the phone UI is currently visible.
This is useful when you want to prevent duplicated UI actions or only execute logic while the phone is open.
Start A Call
Start an audio or video call from your client resource.
Available call types:
callerNumberOverride is optional and can be used when your script needs to display a custom caller number.
Open A Phone App
Open a specific phone app while the phone is visible.
This export returns false if the phone is closed or if the app ID is invalid.
Use it when you want to redirect players to a specific app from another script.
Inventory Item Exports
These server exports are designed for inventory items, usable handlers or ox_inventory item definitions.
| Export | Use |
|---|---|
useSimCard(...) | Handles SIM card item usage |
usePowerbank(source) | Uses a power bank to charge the phone |
useWirelessEarbuds(...) | Handles wireless earbuds usage |
Housing Battery Charger
If you use qs-housing, you can register or remove phone battery charger points inside houses.
| Export | Description |
|---|---|
BatteryRegisterHousingCharger(houseId, coords, radius) | Registers a charger location inside a house |
BatteryUnregisterHousingCharger(houseId) | Removes the charger linked to that house |
Iframe JavaScript Bridge
Custom iframe apps can communicate with the smartphone using the JavaScript bridge SDK.
Load the SDK inside your custom app HTML:
Create the bridge connection:
Wait until the phone bridge is ready:
Get the current phone state:
Example returned state:
JavaScript Bridge API Methods
Common methods available through api:
| Method | Description |
|---|---|
getPhoneState() | Returns current phone visibility, mode, active app and screen |
openPhoneApp(appId) | Opens another phone app |
closeCurrentPhoneApp() | Closes the current app |
getThemeMode() | Returns the current phone theme mode |
translateText(key) | Returns a translated phone text |
showToastNotification(payload) | Shows a toast notification |
openTextPrompt(payload) | Opens a text input prompt |
openOptionPicker(payload) | Opens an option selector |
pickGalleryMedia(payload) | Opens the gallery picker |
pickGif() | Opens GIF picker |
startRecorder() | Starts recorder |
stopRecorder() | Stops recorder |
Example toast:
Example text prompt:
Example gallery picker:
Custom Bridge Events
Use bridge events to communicate between your iframe UI and your Lua resource.
Listen for custom events:
Use this for advanced integrations where your custom app needs to send actions to your Lua logic.
Client Events
You can listen to these events inside your own client resource.
| Event | Use |
|---|---|
phone:pushNotification | Shows a push notification in the phone UI |
phone:notification | Shows a simple toast notification |
phone:usable:open | Triggered when the player uses the phone item |
phone:incomingCall | Triggered when a call is received |
phone:callState | Sends call session updates |
Example client push notification without exports:
Custom Framework Hooks
Framework and notification behavior can be edited inside:
Available files:
| File | Use |
|---|---|
custom/client.lua | Client notifications and 3D text helpers |
custom/server.lua | Server notifications and phone push notification handlers |
custom/<framework>/client.lua | ESX / QB / framework client bridge |
custom/<framework>/server.lua | ESX / QB / framework server bridge |
Useful server functions:
General behavior can also be configured inside:
This includes item name, require item behavior, debug mode, store settings and more.
NUI Callback Custom App To Game
Register callbacks inside your own client resource when your custom app needs to communicate with the game.
From your React, Vue or custom UI, use the standard FiveM fetchNui pattern targeting your own resource name.
The starter template includes an example:
This is the recommended way to connect your custom app interface with Lua actions.
