-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.lua
More file actions
34 lines (31 loc) · 1.23 KB
/
server.lua
File metadata and controls
34 lines (31 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
local function registerApp()
local success, err = pcall(function()
exports['dw-phone']:registerApp({
id = 'dev.dwscripts.external.exampleapp',
name = 'Example App',
author = 'ipatavatsizz',
version = '1.0.0',
isHidden = false,
isSystemApp = false,
categories = {'COMMUNICATION'},
permissions = {'CONTACTS'},
description = 'Example app for demonstrating how to integrate with dw-phone.',
icon = 'https://play-lh.googleusercontent.com/TViTe4ePsFQawXjjJhD0VN-fV7sk_GovVn6nJBLalgLJETbM32eW6pvfAW-j6HolLXA',
url = 'https://cfx-nui-dw-exampleapp/index.html'
})
end)
if success then
print('[Example App] Successfully registered to dw-phone.')
else
-- dw-phone çalışmıyorsa veya registerApp export'u henüz yoksa hata fırlatılır ve buraya düşer
print('[Example App] dw-phone is not ready yet or not running. Waiting for reload event...')
end
end
AddEventHandler('onResourceStart', function(resourceName)
if resourceName == GetCurrentResourceName() then
registerApp()
end
end)
AddEventHandler('dw-phone:appstore:ready', function()
registerApp()
end)