MQTT Notifications

Managing notifications.
As a developer, in some cases, you need to send real-time notifications to users following events or actions according to your application logic. For example when a user sends a friend request to another user. The latter must receive an instant notification to approve or deny the request without waiting to refresh the page or re-open the Android application.
MQTT notifications should not be confused with WEB push notifications or android FCM notifications. MQTT notifications are sent using the socket connection established between the android application or the WEB browser and our MQTT server. No intermediary server is used.

Sending Notification

An MQTT notification is made up of the following fields:
id of user that will receive the notification (mandatory)
Notification title (mandatory)
Notification content : text or html (mandatory)
Url of image or photo to show (optional)
JSON additional data for your application need (optional)
For example to send Notification using PHP SDK.
require_once vendor/autoload.php;
"title":"friend Request",
"content":"John Doe sent you a friend request",
$n=new telifoun\mqttchat\notifications();
"ok": true,
"data": {
"notification_id": 8555

Get Notification

You can get already sent notification content by id.
require_once vendor/autoload.php;
$n=new telifoun\mqttchat\notifications();