Phone integration

Phone app integration. (sh_phones.lua)

Default phone options

Config.PhoneScript = 'lb-phone'
--Suported phone names:
--[[
    standalone -- no phone, for custom use only
    lb-phone
    gksphone
    qs-smartphone-pro
    codem-phone
    yseries
    high-phone
]]

NUI messages

Sending NUI messages to update data of the UI on the app.

if not IsDuplicityVersion() then
    Config.SendAppMessage = function(event, data)
        local id = GetCurrentResourceName()

        if Config.PhoneScript == 'lb-phone' then
            exports["lb-phone"]:SendCustomAppMessage(id, {
                type = event, data = data
            })
        elseif Config.PhoneScript == 'gksphone' then
            exports["gksphone"]:NuiSendMessage({
                type = event, data = data
            })
        elseif Config.PhoneScript == 'qs-smartphone-pro' then
            SendNUIMessage({ action = event, data = data })
        elseif Config.PhoneScript == 'yseries' then
            exports.yseries:SendAppMessage(id, {
                action = event, data = data
            })
        elseif Config.PhoneScript == 'high-phone' then
            exports['high-phone']:sendAppNui(id, {
                action = event,
                payload = data
            })
        elseif Config.PhoneScript == 'codem-phone' then
            SendNUIMessage({
                type = event,
                payload = data
            })
        elseif Config.PhoneScript == 'standalone' then
            SendNUIMessage({ type = event, data = data })
        end
    end
end

Notifications

Sending notifications.

Calling

Registering app

Last updated