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.
Config.SendPhoneNotify = function(title, description)
local id = GetCurrentResourceName()
if Config.PhoneScript == 'lb-phone' then
exports["lb-phone"]:SendNotification({
app = id,
title = title,
content = description,
})
elseif Config.PhoneScript == 'gksphone' then
local NotifData = {
title = title, -- Notification header
message = description, -- Notification content message
icon = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png", -- Icon of the notification
duration = 5000, -- specify how many seconds,
type = "success", -- the home screen will also appear on the notification side.
buttonactive = false, -- Activate if you want to use the button function
}
exports["gksphone"]:Notification(NotifData)
elseif Config.PhoneScript == 'qs-smartphone-pro' then
exports['qs-smartphone-pro']:SendTempNotificationOld({
title = title,
text = description,
app = id,
timeout = 5000,
disableBadge = true, -- Disables the badge on the app icon.
})
elseif Config.PhoneScript == 'yseries' then
print("yseries notification:", title, description)
elseif Config.PhoneScript == 'high-phone' then
exports['high-phone']:sendNotification({
title = title,
content = description,
application = { name = id },
icon = {
name = 'fas fa-bag-shopping',
imageUrl = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png",
color = '#fff',
sizeMultiplier = 1.0
},
duration = 5000
})
end
end
onfig.CallRestaurant = function(restaurant, number)
if Config.PhoneScript == 'lb-phone' then
exports["lb-phone"]:CreateCall({
number = number,
company = restaurant,
videoCall = false,
hideNumber = false,
})
return true
elseif Config.PhoneScript == 'gksphone' then
local options = {
number = number, --string
videoCall = false, -- true or false / boolean
hideNumber = false, -- true or false / boolean
}
exports["gksphone"]:CreateCall(options)
return true
elseif Config.PhoneScript == 'qs-smartphone-pro' then
local id = GetCurrentResourceName()
exports['qs-smartphone-pro']:createCall(restaurant, number, "https://cfx-nui-" .. id .. "/web/dist/app_logo.png", false)
return true
elseif Config.PhoneScript == 'yseries' then
return exports.yseries:CreateCall(number)
elseif Config.PhoneScript == 'high-phone' then
exports['high-phone']:startCall(number, false)
return true
end
return false
end
CreateThread(function()
local id = GetCurrentResourceName()
-- local url = GetResourceMetadata(id, "ui_page", 0)
local url = "peuren_foodapp/"..GetResourceMetadata(id, "ui_page", 0)
local appLabel = "PeuEats"
local appDescription = "Deliver food to customers and earn money or order food to your location."
if Config.PhoneScript == 'lb-phone' and not IsDuplicityVersion() then
local success, errorMessage = exports["lb-phone"]:AddCustomApp({
identifier = id,
name = appLabel,
icon = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png",
description = appDescription,
fixBlur = true,
ui = url
})
print("Custom app added:", success, errorMessage)
elseif Config.PhoneScript == 'gksphone' and IsDuplicityVersion() then
local appData = {
name = id, --- A unique name
description = appDescription, -- App description that will appear in the app store
icons = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png", -- logo url
appurl = "https://cfx-nui-" .. id .. "/web/dist/index.html", -- custom app url
url = "/customapp", -- do not touch this part
blockedjobs = {},
allowjob = {},
signal = true,
show = true,
labelLangs = { -- App name by languages
af = appLabel,
ar = appLabel,
cs = appLabel,
de = appLabel,
en = appLabel,
es = appLabel,
fr = appLabel,
id = appLabel,
nl = appLabel,
["pt-PT"] = appLabel,
ro = appLabel,
sv = appLabel,
th = appLabel,
tr = appLabel,
uk = appLabel,
["zh-TW"] = appLabel
}
}
exports["gksphone"]:AddCustomApp(appData)
elseif Config.PhoneScript == 'qs-smartphone-pro' and not IsDuplicityVersion() then
exports['qs-smartphone-pro']:addCustomApp({
app = id,
image = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png",
ui = "https://cfx-nui-" .. id .. "/web/dist/index.html",
label = appLabel,
job = false,
blockedJobs = {},
timeout = 5000,
creator = 'Peuren.dev',
category = 'social',
isGame = false,
description = appDescription,
age = '16+',
extraDescription = {}
})
elseif Config.PhoneScript == 'codem-phone' and not IsDuplicityVersion() then
exports['codem-phone']:AddCustomApp({
identifier = id,
name = appLabel,
icon = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png",
ui = "https://cfx-nui-" .. id .. "/web/dist/index.html",
description = appDescription,
defaultApp = false,
notification = true,
addAppStore = true, -- If true, app appears in App Store instead of home screen
developer = 'Peuren.dev', -- Optional: Developer name shown in App Store
headerImage = "https://i.imgur.com/EPe8glK.png", -- Optional: Header image for App Store page (e.g., 'nui://phone-app-example/ui/header.png')
swiperItems = {}, -- Optional: Preview images for App Store page
job = {},
})
elseif Config.PhoneScript == 'yseries' and not IsDuplicityVersion() then
local dataLoaded = exports.yseries:GetDataLoaded()
while not dataLoaded do
Wait(500)
dataLoaded = exports.yseries:GetDataLoaded()
end
exports.yseries:AddCustomApp({
key = id,
name = appLabel,
defaultApp = false,
ui = "https://cfx-nui-" .. id .. "/web/dist/index.html", -- built version
icon = {
yos = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png", -- YPhone OS icon.
humanoid = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png", -- YFlip OS icon.
},
})
elseif Config.PhoneScript == 'high-phone' and not IsDuplicityVersion() then
exports['high-phone']:addApplication(id, {
developer = "Peuren.dev",
preAdded = false,
size = 66.77,
icon = {
imageUrl = "https://cfx-nui-" .. id .. "/web/dist/app_logo.png",
background = "#0E0F0E"
},
externalUrl = "https://cfx-nui-" .. id .. "/web/dist/index.html"
}, {
["en"] = {
label = appLabel,
description = appDescription
}
})
end
end)