GFX Phone Custom Apps - Lua API (Exports and Events)
Every export below is on exports['gfx-phone']. Every call except AddCustomApp acts only on the
calling resource’s own app (checked with GetInvokingResource()).
localphone=exports['gfx-phone']-- A delivery job: Lemon Pulse activity + widget + notification.RegisterNetEvent('myjob:client:started',function(stops)phone:StartCustomAppIsland('deliveries','route',{leading={icon='app'},trailing=('0/%d'):format(stops),title='Delivery route',subtitle='Head to the first stop',progress=0,buttons={{id='cancel',label='Cancel',style='destructive'}},})end)RegisterNetEvent('myjob:client:progress',function(done,stops)phone:UpdateCustomAppIsland('deliveries','route',{trailing=('%d/%d'):format(done,stops),progress=done/stops})phone:UpdateCustomAppWidget('deliveries','today',{value=tostring(done),label='Deliveries today'})ifdone==stopsthenphone:EndCustomAppIsland('deliveries','route')phone:SendCustomAppNotification('deliveries',{title='Route complete',body='Return to the depot for your pay.'})endend)