Send an SMS message

This is a piece of code showing how to send an SMS. When calling messages_send_message() API the callback is set to check whether the message was successfully sent. PRIVILEGES: http://tizen.org/privilege/message.write http://tizen.org/privilege/message.read
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//    PRIVILEGES needed to be set in tizen-manifest.xml:
//    http://tizen.org/privilege/message.write
//    http://tizen.org/privilege/message.read
#include <messages.h>
messages_service_h msg_service = NULL;
//Callback which is going to be performed when SMS sending request is processed
void on_message_sent(messages_sending_result_e result, void *user_data)
{
    messages_message_h handle = (messages_message_h)user_data;
    if (result == MESSAGES_SENDING_SUCCEEDED)
    {
        LOGI("Message sent successfully!");
    }
    else
    {
        LOGE("Sending failed!");
    }
    if (messages_destroy_message (handle) == MESSAGES_ERROR_NONE)
    {
        LOGI("Message destroyed!");
    }
    else
    {
        LOGI("Message destruction failed!");
    }
}
//Opening messaging service
if (messages_open_service(&msg_service) == MESSAGES_ERROR_NONE)
{
    LOGI("Messaging service opened!");
}
else
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX