Integrations

This section is dedicated to integrations within the script. Here you’ll find connections, adapters, or bridge files that allow the system to interact seamlessly with other Quasar resources or third-party scripts. These integrations ensure better compatibility, data synchronization, and a smoother experience across your server’s ecosystem.


Ambulance Dispatch using Messages app

This snippet will be for esx_ambulancejob but you can integrate it wherever you want since it is standalone, in this example we will edit esx_ambulancejob/client/main.lua and replace the following function.

function SendDistressSignal()
  local coords = GetEntityCoords(PlayerPedId())
  local street = GetStreetNameAtCoord(coords.x, coords.y, coords.z)
  local streetName = GetStreetNameFromHashKey(street)
  local message = json.encode(coords)
  TriggerServerEvent('phone:sendSOSMessage', 'ambulance', message, 'location')
  Citizen.Wait(100)
  message = ([[
      I need help! I'm at %s. Please fast come here!
  ]]):format(streetName)
  TriggerServerEvent('phone:sendSOSMessage', 'ambulance', message, 'message')
end
Pop-up Notifications Integration

The notification system in this version of Smartphone is more complex and configurable, since now we will have the new disableBadge value, this will serve to enable or disable the red notification on the application icon. In the case of the server side, we will have to detail the phone number using the GetPhoneNumberFromIdentifier export, unfold the sections and we will teach you the basic use of this system.


Client-Side Exports

-- Its same as the old one
RegisterCommand('notifiOld', function(source)
    exports['qs-smartphone-pro']:SendTempNotificationOld({
        title = 'Test',
        text = 'This is a test notification.',
        app = 'settings',
        timeout = 5000,
        disableBadge = true, -- Disables the badge on the app icon.
    })
end, false)

Server-Side Exports

This integration is more advanced and we will use the phone number to send it.

-- This export sends a basic notification to a phone number.
RegisterCommand('sendNewNotification', function(source, args)
    local phone = exports['qs-smartphone-pro']:GetPhoneNumberFromIdentifier(GetPlayerIdentifier(source), false)
    local disableTempNotification = false -- Disables the temporary notification. (Pop up notification)
    exports['qs-smartphone-pro']:sendNotificationOld(phone, {
        app = 'twitter',
        msg = 'Hello world!',
        head = 'Quasar'
    }, disableTempNotification)
end, false)
Pop-up Notification on Dynamic Island

This system will work in the same way as the basic notification but we will leave a mini user guide so you know how to export it correctly.


Client-Side Exports

In this case it will be as in the previous one, you can use the example to understand the function.

-- Example of how to use the notification function.
RegisterCommand('notifi', function(source)
    exports['qs-smartphone-pro']:SendTempNotification({
        title = 'Test',
        text = 'This is a test notification.',
        app = 'settings',
        timeout = 5000,
        disableBadge = true, -- Disables the badge on the app icon.
    })
end, false)

Server-Side Exports

This integration is more advanced and we will use the phone number to send it.

-- This export sends a new notification to a phone number.
RegisterCommand('sendNewNotification', function(source, args)
    local phone = exports['qs-smartphone-pro']:GetPhoneNumberFromIdentifier(GetPlayerIdentifier(source), false)
    local disableTempNotification = false -- Disables the temporary notification. (Pop up notification)
    exports['qs-smartphone-pro']:sendNotification(phone, {
        app = 'twitter',
        msg = 'Hello world!',
        head = 'Quasar'
    }, disableTempNotification)
end, false)
Mail integration into other assets

The Mails system has integration of both the client and the server.

Client-Side Exports

-- Example of how to use the sendNewMail event.
RegisterCommand('mailTest', function(source)
    TriggerServerEvent('phone:sendNewMail', {
        sender = 'Movistar Plus',
        subject = 'Family telephone balance promotion',
        message = 'Enjoy the family balance at only $8.50 per month, what are you waiting for?'
    })
end, false)

Server-Side Exports

-- Example of how to use the sendNewMail export.
RegisterCommand('mailTest', function(source)
    exports['qs-smartphone-pro']:sendNewMail(source, {
        sender = 'Quasar',
        subject = 'Es tu culpa',
        message = 'Es tu culpa que no haya un ejemplo de como usar esto...'
    })
end, false)

Quest integration in Mail

The Mails system includes a completely optional option to integrate a button that responds with a specific event, which will operate through the next button value. Expand the tab according to your needs.

Client-Side Exports

-- Example of how to use the sendNewMail event and Quest button!
RegisterCommand('mailTest', function(source)
    TriggerServerEvent('phone:sendNewMail', {
        sender = 'Movistar Plus',
        subject = 'Family telephone balance promotion',
        message = 'Enjoy the family balance at only $8.50 per month, what are you waiting for?'
        -- Execution example for the button
        button = {
            enabled = true,
            buttonEvent = 'phone:client:movistarEvent',
        }
    })
end, false)

Server-Side Exports

-- Example of how to use the sendNewMail event and Quest button!
RegisterCommand('mailTestSv', function(source)
    exports['qs-smartphone-pro']:sendNewMail(source, {
        sender = 'Quasar',
        subject = 'Es tu culpa',
        message = 'Es tu culpa que no haya un ejemplo de como usar esto...',
        -- Execution example for the button
        button = {
            enabled = true,
            buttonEvent = 'phone:client:movistarEvent',
        }
    })
end, false)

Administrative Mail Command (ads)

This command can be sent using quotes to be able to send long texts.

The Mail system does not end here, we also have a brief command to give community announcements, this command will send an Mail to the entire server giving it a general message.

The way the command is used can be done with quotes to send long texts. The command is very simple, we can use it in the following way /sendmail subject message.

Copy

/sendmail "Important" "Players please disconnect from the server for brief maintenance."
Create Custom Apps?

Please do not open a ticket if you encounter issues related to your development skills.

The Smartphone PRO includes an open-source system for creating custom applications, allowing developers to easily build and integrate apps into the phone's App Store. Custom apps automatically run on the phone when started on the server.

A template app, custom-app-temple, is included in the package to simplify development. It provides snippets, events, and examples for app creation, including menu functionality, exclusive inputs, and more. The template works out of the box and appears in the App Store when started.


Basic temple with jQuery

This tutorial is basic and includes multiple examples using jQuery, it is simpler for beginners.

Advanced Tempering with React

This template is more advanced and React includes a unique protection and optimization system, recommended as long as you are a good developer.

https://github.com/quasar-store-organizations/custom-app-template