Client exports

Notifications

Client exports that show a notification on the player's own phone.

A notification sent from the client is shown only. It is not saved, so a player who is offline never sees it. To save a notification for a phone, use the server exports.

#SendNotification

Shows a notification on this player's phone.

lua---@class PhoneNotificationData
---@field app? string app id; decides the icon and follows that app's notification switch. Default 'system'
---@field title? string up to 100 characters
---@field content? string up to 500 characters (`text` and `description` are accepted too)
---@field icon? string icon name or image link, up to 512 characters
---@field thumbnail? string image link, up to 512 characters
---@field timeout? number banner time in milliseconds, 0 to 600000. Default 5000
---@field sound? boolean false for a silent notification
---@field data? table passed through to the app

---@param data PhoneNotificationData
exports['fx-phone']:SendNotification(data)
luaexports['fx-phone']:SendNotification({ app = 'garage', title = 'Garage', content = 'Your car is ready.' })
  • Longer texts are cut to the limits above.
  • An icon or thumbnail that points at an outside host is dropped unless the host is allowed in ServerConfig.Upload.AllowedHosts. Files of a resource (nui://my-resource/logo.png) always load. See Upload.
  • The same notification can be sent from the server with the net event fx-phone:client:notification: see Events you can trigger.

#PhoneNotification

Shows a notification in the short positional form older scripts use.

lua---@param title string|PhoneNotificationData a title, or one table as for SendNotification
---@param text? string
---@param icon? string
---@param timeout? number milliseconds
exports['fx-phone']:PhoneNotification(title, text, icon, timeout)
luaexports['fx-phone']:PhoneNotification('Dispatch', '10-31 at Legion Square', 'siren', 6000)