> For the complete documentation index, see [llms.txt](https://cylexdev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cylexdev.gitbook.io/docs/cylex-phone/exports-and-events/client-exports/notification.md).

# Notification

#### PhoneNotification  <a href="#user-content-phonenotification-server-side" id="user-content-phonenotification-server-side"></a>

```lua
-- data: table - notification data parameters
-- return: none

-- Sends a notification to the phone.
-- If the app is defined in persistent settings, it will stay on the lockscreen.

local data = {
    title = "Bank",
    text = "You received $500!",
    icon = { name = 'app-icon/bank.png' }, -- Icon image path inside html/img
    timeout = 4, -- Notification duration in seconds
    
    -- The '_data' table handles advanced routing, sounds, and persistent behaviors
    _data = {
        app = 'bank', -- REQUIRED for persistent lockscreen notifications. Target app (e.g. 'twitter', 'messages')
        
        notification_sound = true, -- Check phone sound settings and play default notification sound
        notification_3D = false,   -- If true, plays the sound as 3D audio emitting from the player
    }
}

exports['cylex_phone']:PhoneNotification(data)

--------------------------------------------------------------------------------------

-- Alternative Simple Usage (No advanced _data parameters)
-- PhoneNotification(title, text, icon, timeout)
exports['cylex_phone']:PhoneNotification("Title", "Message here", { name = 'app-icon/messages.png' }, 5)
```

#### DoPhoneConfirmation  <a href="#user-content-dophoneconfirmation-client-side" id="user-content-dophoneconfirmation-client-side"></a>

```lua
-- pTitle: string - The header/title of the confirmation
-- pText: string - The description/question text
-- pIcon: table - (Optional) Icon data, defaults to settings.png if nil
-- pCallback: function - (Optional) Callback function triggered on response
-- return: boolean - Returns true if accepted (Yes), false if declined (No) or timed out

-- Triggers an interactive confirmation dialog on the player's phone screen.
-- Note: The dialog automatically times out and returns false after 30 seconds.

local iconData = { name = 'app-icon/settings.png' }

-- Using Promise (Yields until answered)
local result = exports['cylex_phone']:DoPhoneConfirmation("Incoming Request", "John Doe wants to join your group. Accept?", iconData)
if result then
    print("User clicked Yes!")
else
    print("User clicked No, or request timed out.")
end

-- Using Callback function
exports['cylex_phone']:DoPhoneConfirmation("Warning", "Are you sure you want to delete this?", nil, function(result)
    if result then
        print("Action confirmed via callback")
    end
end)

```
