IOTC Platform  Ver: 4.3.6.2-0-ge1f616e
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
PushNotification.h File Reference
#include "AVCommon.h"

Functions

int32_t avServEnablePushNotification (const char *key, const char *setting_str, avNotificationSettingChangeFn callback)
 Enable push notification service.
 
int32_t avServPushNotification (TUTKJsonObject *notification_obj, uint32_t timeout_msec)
 AV device push a notification to server.
 
int32_t avServPushThumbnail (TUTKJsonObject *notification_obj, AvPushFileObject *thumbnail_obj, uint32_t timeout_msec)
 AV device push a notification to server with thumbnail.
 

Detailed Description

This file describes AV module APIs for push notification service.

Function Documentation

int32_t avServEnablePushNotification ( const char *  key,
const char *  setting_str,
avNotificationSettingChangeFn  callback 
)

Enable push notification service.

This function is used by av device to enable push notification service with the sepicified push notification settings string.

Parameters
key[in]The key used to encrypt/decrypt push notification setting string.
setting_str[in]The encrypted string that contain the push notification settings. This encryptd string can be derived from registed avNotificationSettingChangeFn callback when push notification settings changed, and this parameter can be NULL if you never get this settings from avNotificationSettingChangeFn before.
callback[in]Push notification settings change handler callback function
Returns
AV_ER_NoERROR if enable push notification service successfully
Error code if return value < 0
Attention
This function is not support for av client
See Also
avServPushNotification(), avNotificationSettingChangeFn
int32_t avServPushNotification ( TUTKJsonObject notification_obj,
uint32_t  timeout_msec 
)

AV device push a notification to server.

This function is used by device to push a notification to server when some event happened and device want to notify AV clients with event messages.

Parameters
notification_obj[in]The json object contains a list of key value pair for push server to generate the push message. The key and value should be a string.
timeout_msec[in]The timeout for this function in unit of millisecond, give 0 means block forever
Returns
AV_ER_NoERROR if push notification successfully
Error code if return value < 0
Attention
(1) Recommended value of timeout: 1000 millisecond ~ 30000 millisecond (2) This function is not support for av client
See Also
avServEnablePushNotification()
int32_t avServPushThumbnail ( TUTKJsonObject notification_obj,
AvPushFileObject thumbnail_obj,
uint32_t  timeout_msec 
)

AV device push a notification to server with thumbnail.

This function is used by device to push a notification with thumbnail to server when some event happened and device want to notify AV clients with event messages.

Parameters
notification_obj[in]The json object contains a list of key value pair for push server to generate the push message. The key and value should be a string.
thumbnail_obj[in]Information of the thumbnail which will be pushed to server, see AvPushFileObject
timeout_msec[in]The timeout for this function in unit of millisecond, give 0 means block forever
Returns
AV_ER_NoERROR if push notification successfully
Error code if return value < 0
Attention
(1) Recommended value of timeout: 1000 millisecond ~ 30000 millisecond (2) This function is not support for av client
See Also
avServEnablePushNotification()