Messaging Configuring

The SmartTUBE is able to send Information Messages and Event-driven Notifications to the end-user devices using Long Polling or Push methods. From the user side, they differ in that Push notifications can be displayed on the device regardless of whether the SmartTUBE app is running or not. The Long Polling method displays messages only when the SmartTUBE application is open.

How the Long Polling Notifications Work

  1. The SmartTUBE front-end server and the app support a special set of notification commands (including commands for displaying the Simple and Watermark messages)
  2. The SmartTUBE app maintains a permanent session with the front-end server on which Long Polling is configured and subscribes to notifications (using the SmartTUBE End-User Device API method notifications/subscribe).
  3. When you submit the message sending in the SmartTUBE Admin Console > Messages menu, the SmartTUBE SDP server generates a notification to the Long Polling server in the following format: http[s]://[long_polling_server_host]:[port]/api/v1/notifications/notify?notification=command?uuid=[device_UID]&[notification_string]
  4. The Long Polling server passes the notification to the SmartTUBE apps subscribed to this notification.
  5. Upon the notification receipt, the SmartTUBE app displays the message text on a screen.
  6. Devices that were offline when the message sending occurred receive actual messages at startup using the messages/list method.

Configuring the Long Polling Notifications

Typically, the Long Polling technique is used by default and available to the SmartTUBE operator out of the box.

How the Push Notifications Work

The implementation of Push notifications for Android and iOS platforms is illustrated below:

Image1

Image2

Configuring the Push Notifications

To enable the Push notifications:

  1. Add the following settings to the configuration file /opt/smartlabs/smarttube5/conf/data-server.conf on the SmartTUBE data-server, adapting them to your case:

component ={

   properties {

       # PUSH notification settings for Apple devices

       applePush = {
           use = true # Flag to use the PUSH notifications for Apple devices. Default – false.
           productionMode = true # True – use the Production APNS mode; false – use the Sandbox APNS mode. Default – true.
           appIdCommon = “some.app.ID” # App ID, Bundle ID for all devices. Default – null.
           connectionUseProxy = false # Flag to use a proxy. Default – false.
           connectionProxyHost = “192.168.0.1” # Proxy host
           connectionProxyPort = 111 # Proxy port
           # Token-based connection (XOR) – by default
           tokenFilePath = “./notification/apns/token/auth_key.p8” # Authentication token signing key (text file)
           tokenTeamId = “ISS” # ISS
           tokenKeyId = “KID” # KID
           tokenAppIdSeparate = false # Flag to use separate app ID for iPhones and iPads. If true, must be filled any or both tokenAppIdIphone/tokenAppIdIpad. Default – false.
           tokenAppIdIphone = “tv.test.smartlabs.Lime.Iphone” # App ID, Bundle ID for iPhones
           tokenAppIdIpad = “tv.test.smartlabs.Lime.Ipad” # App ID, Bundle ID for iPads
           # Certificate-based connection (XOR)
           certificateUse = false # Flag to use the certificate-based connection. Default – false.
           certificateFilePath = “./notification/apns/cert/push_service.p12” # Password protected PKCS#12 file
           certificatePassword = “XYZ-PASS” # Password for the PKCS#12 file
       }
       # PUSH notification settings for Android devices
       androidPush = {
           use = true # Flag to use the PUSH notifications for Android devices. Default – false.
           serviceAccountFilePath = “~./notification/fcm/service-account-file.json” # Firebase service account JSON file
       }
   }
}

  1. SmartTUBE apps, when launched, download a configuration file from the SmartTUBE cache-server containing settings common to all subscribers of the operator. So you need to add the following parameter to the configuration file /opt/smartlabs/nginx/html/srv-pub/networkConfig/config.cfg of the SmartTUBE cache-server:

pushNotificationsEnabled = true // Flag to enable the Push notifications for the Simple and Event-driven notifications by default

Another option is to add this parameter to the setup.json file for specific devices using the SmartTUBE Device Manager.

  1. Please also check with a SmartLabs representative if the version of your SmartTUBE apps support Push notifications.
CONTENTS
Sign-in
Sign-in with your SmartLabs Support Portal account credentials to see non-public articles.