Agency Docs
QBESXStandalone

Agency-Phone تطبيقات مخصصة

هاتف حديث متعدد الأطر لـ FiveM مع كشف تلقائي لـ QBCore وESX.

v26.5مدفوع7 صفحات

🧩 Build a custom app for Agency-Phone

There are two ways to put an app on the phone. Pick the one that fits you:

MethodBest forWhat you touch
A. SDK (external resource)Vendors and scripts adding an app with their own iconOnly your own resource. Zero edits to agency-phone.
B. Drop-in (inside agency-phone)Server owners adding a native screen inside the phone UIconfig.lua + apps/ (+ html/js for a screen)

If you ship an app to other servers, use Method A. It needs no source from us and keeps working across updates.

B Drop-in, a native screen inside the phone

For a screen rendered by the phone itself (not your resource). This edits agency-phone's own files.

StepFileEditable in escrow build?
1. App entry in AgencyConfig.Appsconfig.lua✓ yes
2. RegisterNUICallback logicapps/<id>_client.lua (+ _server.lua)✓ yes
3. Screen <div id="app-<id>">html/index.html✗ encrypted
4. case '<id>': in openApp() + loaderhtml/js/phone.js✗ encrypted

Steps 3 and 4 live in escrow-encrypted files, so a native screen needs a source / unlocked build. If you only have the escrow version, use Method A instead (your screen lives in your own resource). Reference files inside the resource: apps/testapp_client.lua and apps/dispatch_client.lua.

📋 Other phone exports

Client

ExportReturnsDescription
IsPhoneOpen()booleanPhone currently open.
IsPhonePoweredOn()booleanDevice powered on.
HasPhone()booleanPlayer owns a phone item.
HasCarrierContract()booleanActive eSIM / contract.
GetPhoneData()tableSnapshot of phone state.
PhoneNotification(title, text, icon, color, timeout, acceptIcon, denyIcon)voidIn-phone notification.
StartCall(contact)voidCall { name, number }.
StartAgencyPayCheckout(opts)voidAgencyPay checkout (see below).

Server

ExportDescription
SendMail(identifier, mailData)Deliver mail to a player (online or offline).
AddChirp(data)Post a message to the Pulse social feed.

NUI ↔ Lua bridge (Method B)

DirectionJS sideLua side
JS → LuafetchNUI('callbackName', data)RegisterNUICallback('callbackName', fn)
Lua → JSlisten for action in window.onmessageSendNUIMessage({ action = '...' })

💳 AgencyPay checkout

Charge the player's wallet from any resource.

exports['agency-phone']:StartAgencyPayCheckout({
    merchant = 'My Shop', title = 'Agency Pay', subtitle = 'Checkout',
    label = 'Premium Coffee', amount = 24.50,
    icon = 'fa-solid fa-mug-hot', accent = '#ff9f0a',
    clientEvent = 'myshop:client:agencyPayResult',
    serverEvent = 'myshop:server:agencyPayResult',
    metadata = { orderId = 'order_2048' },
})

RegisterNetEvent('myshop:client:agencyPayResult', function(result)
    if result.status == 'paid' then
        -- deliver the goods
    end
end)

The result payload includes status (paid / cancelled / failed), amount, cardId, balance and your metadata.

🐛 Troubleshooting

SymptomFix
Icon doesn't appear (SDK)Update agency-phone to the latest Keymaster build, Wait(1500) before RegisterApp, and add dependency 'agency-phone' to your manifest.
Tapping does nothing (SDK)Your agency-phone:client:openApp handler must match your id exactly (case-sensitive).
Custom image not showingUse a full NUI URL https://cfx-nui-<your-resource>/path/icon.png and list the file in files { } in your manifest.
Icon doesn't appear (drop-in)enabled = true and installed = true in the config entry.

Questions, or need a hand? Join the Agency Scripts Discord.

ما زلت عالقًا بعد هذه الصفحة؟ فريق الدعم يتولّى الأمر من هنا.