Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

How to read SMS Inbox in WRT Widget

From Wiki
Jump to: navigation, search

Article Metadata
Tested with
Devices(s): Nokia N97 Mini
Platform(s): S60 5th Edition
S60 5th Edition
Keywords: IMessaging.GetList(), SMS Inbox.
Created: vasant21 (21 Jan 2010)
Last edited: hamishwillee (14 Jun 2013)

Note.pngNote: Support for S60 Platform Services through Platform Services APIs was introduced in WRT 1.1. The Platform Services 1.0 APIs were formerly known as Service APIs. Widgets created using WRT 1.1 Platform Services APIs do not work with WRT 1.0.


This article and code snippet below demonstrates how to read SMS inbox messages synchronously using the Platform Service 1.0 Messaging Api in S60 Web Runtime.

Using Platform Services 1.0

To obtain access to the service object for the Messaging Service API in Platform Services 1.0, the device.getServiceObject("Service.Messaging", "IMessaging") method is used.


<script language="javascript">
function readInbox(){
try {
var so = device.getServiceObject("Service.Messaging", "IMessaging");
} catch(e ) {
alert("Error in getting Messaging interface \n" + e);
// Our criteria is to get inbox SMS messages.
var criteria = {
// Specifies the type of messaging objects to retrieve.
// Possible values "Inbox", "NewMessage" etc..
Type : "Inbox",
Filter :{
//Specifies the type(s) of messages to retrieve.
// Possible values are "SMS", "MMS" & "unknown"
MessageTypeList : ["SMS"]
// Lets get the messages with the above prepared criteria, synchronously.
var result = so.IMessaging.GetList(criteria);
// Lets print the received message list in html page.
var items = result.ReturnValue;
var message = "";
var list = "";
while (( message = items.getNext()) != undefined ){
list += "<b>"+message.Sender+"</b> - "+ message.Subject + "<br/><br/>";
document.getElementById('log').innerHTML += list;
<body onLoad="readInbox()">
<div id="log">Read SMS Inbox in WRT Widget Example<br/></div>

Sample Widget

Here is a sample widget application, uses Platform Services 1.0 Messaging API.


  • When the application is launched, the user will see the list of inbox messages in the HTML page, if the inbox is not empty.
This page was last modified on 14 June 2013, at 06:28.
42 page views in the last 30 days.