Languages

Menu
Sites
Language
Messaging Api
I am currently working with Message Api in Tizen Native App. I am trying to get all message in my inbox. I open a message service handler and it opens without any problem. I am currently working with for_each_message() Api. From, tizen documentation, i got that it will fetch all sms inside my sms inbox. but when i am using this Api, it only fetched the last sms received. here is my code: void messages_search_callback(messages_message_h msg, int index, int result_count, int total_count, void *user_data) { dlog_print(DLOG_INFO, "inside message search callback"); } int ret = messages_foreach_message(Message_service_handler msh, MESSAGES_MBOX_INBOX, MESSAGES_TYPE_SMS, NULL, NULL, 0, 0, messages_search_callback, NULL); Anyone can help me regarding this?? what should be the return type of callback so that i can iterate all sms in my inbox. Thanks In Advance

Responses

9 Replies
Shaswati Saha

Please share the code of message_search_callback() function.

Mahabub Zoraf
void messages_search_callback(messages_message_h msg, int index, int result_count, int total_count, void *user_data) { dlog_print(DLOG_INFO, "inside message search callback"); }
Shaswati Saha

Where's the code of storing all messages of message box? Please share that one. Here, you've just shared the signature of callback function and body with a simple log print. 

Mahabub Zoraf
can you please share an example??? from tizen message API documentation, i only found this.
Shaswati Saha

FYI, the API facilitates retrieving all the messages of message box. You just need to store and manage them. Please go through data.c file of the sample app SMS for a better understanding how messages_search_callback() function is working. Here, it has retrieved the list of messages. Hope it'll help.

Mahabub Zoraf

Where will i find sample SMS app??? will you plz let me know or if possible, share source code

Shaswati Saha

You'll find it in Tizen Studio Sample App List.

André Reus

hi Mahabub Zoraf 

Please try to post with formatted code. Use Add Code option from top menu. 

void messages_search_callback(messages_message_h msg, int index, int result_count, int total_count, void *user_data) 
 {   
   dlog_print(DLOG_INFO, "inside message search callback");
 } 
int ret = messages_foreach_message(Message_service_handler msh, MESSAGES_MBOX_INBOX, MESSAGES_TYPE_SMS, NULL, NULL, 0, 0, messages_search_callback, NULL);
Mahabub Zoraf
thanks for your suggestion.