Tizen Native API

The MMS API provides functions to add/remove incoming callback for WAP Push messages and register current application to push server.

Required Header

#include <messages.h>

Overview

The WAP PUSH API provides the following functionalities:

  • Adding/Removing incoming callback for WAP Push messages
  • Managing the registration

Related Features

This API is related with the following features:

It is recommended to design feature related codes in your application for reliability.

You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.

To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.

More details on featuring your application can be found from Feature Element.

Functions

int messages_push_add_incoming_cb (messages_service_h service, const char *app_id, messages_push_incoming_cb callback, void *user_data)
 Registers a callback to be invoked when an WAP Push message is received.
int messages_push_remove_incoming_cb (messages_service_h service, const char *app_id)
 Unregisters the WAP push incoming callback function.
int messages_push_register (messages_service_h service, const char *content_type, const char *app_id)
 Registers an application to the mapping table of the WAP Push service.
int messages_push_deregister (messages_service_h service, const char *content_type, const char *app_id)
 De-registers an application from the mapping table of the WAP Push service.
int messages_push_reregister (messages_service_h service, const char *content_type, const char *app_id, const char *dst_content_type, const char *dst_app_id)
 Re-registers an application to the mapping table of the WAP Push service.

Typedefs

typedef void(* messages_push_incoming_cb )(const char *header, const char *body, int body_length, void *user_data)
 Called when an incoming push message is received.

Typedef Documentation

typedef void(* messages_push_incoming_cb)(const char *header, const char *body, int body_length, void *user_data)

Called when an incoming push message is received.

Since :
2.3.1
Parameters:
[in]headerThe header of the push message
[in]bodyThe body of the push message
It is not a null-terminated string.
[in]body_lengthThe length of body
[in]user_dataThe user data to be passed to the callback function
Precondition:
You register this callback using messages_push_set_incoming_cb() for getting an incoming message.
See also:
messages_push_set_incoming_cb()
messages_push_unset_incoming_cb()

Function Documentation

int messages_push_add_incoming_cb ( messages_service_h  service,
const char *  app_id,
messages_push_incoming_cb  callback,
void *  user_data 
)

Registers a callback to be invoked when an WAP Push message is received.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/message.read
Parameters:
[in]serviceThe message service handle
[in]app_idThe "X-WAP-Application-ID" to indicate a destination WAP Push application ID
[in]callbackThe callback function
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this method
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
int messages_push_deregister ( messages_service_h  service,
const char *  content_type,
const char *  app_id 
)

De-registers an application from the mapping table of the WAP Push service.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/message.write
Parameters:
[in]serviceThe message service handle
[in]content_typeThe MIME content type of the content
[in]app_idThe "X-WAP-Application-ID" to indicate a destination WAP Push application ID
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this method
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
int messages_push_register ( messages_service_h  service,
const char *  content_type,
const char *  app_id 
)

Registers an application to the mapping table of the WAP Push service.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/message.write
Parameters:
[in]serviceThe message service handle
[in]content_typeThe MIME content type of the content
[in]app_idThe "X-WAP-Application-ID" to indicate a destination WAP Push application ID
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this method
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
int messages_push_remove_incoming_cb ( messages_service_h  service,
const char *  app_id 
)

Unregisters the WAP push incoming callback function.

Since :
2.3.1
Parameters:
[in]serviceThe message service handle
[in]app_idThe "X-WAP-Application-ID" to indicate a destination WAP Push application ID
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_NOT_SUPPORTEDNot supported
int messages_push_reregister ( messages_service_h  service,
const char *  content_type,
const char *  app_id,
const char *  dst_content_type,
const char *  dst_app_id 
)

Re-registers an application to the mapping table of the WAP Push service.

Since :
2.3.1
Privilege Level:
public
Privilege:
http://tizen.org/privilege/message.write
Parameters:
[in]serviceThe message service handle
[in]content_typeAn element of the composite key for searching registered entry
The MIME content type of the content.
[in]app_idThe composite key for searching mapping information
The "X-WAP-Application-ID" to indicate a destination WAP Push application ID.
[in]dst_content_typeThe MIME content type of the content
[in]dst_app_idThe "X-WAP-Application-ID" to indicate a destination WAP Push application ID
Returns:
0 on success, otherwise a negative error value
Return values:
MESSAGES_ERROR_NONESuccessful
MESSAGES_ERROR_INVALID_PARAMETERInvalid parameter
MESSAGES_ERROR_PERMISSION_DENIEDThe application does not have the privilege to call this method
MESSAGES_ERROR_NOT_SUPPORTEDNot supported