Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


Using the WhiteList/BlackList URI Service with WAPPush

This section provides information about using the WhiteList/BlackList URI service with the WAPPush API. It also provides information on pre-configuring the URI list, using the WAPPush API, and setting message flags.

This section contains the following subsections:

[Top]


How should messages be processed by content handlers

When a WAPPush message arrives, the Push Watcher fetches the message from the WAP Stack. The Push Watcher checks the message origin in the WhiteList and BlackList, and if it is blacklisted, the message is discarded. If the message is whitelisted, or from an unknown origin, then Push Watcher creates a CPushMessage object and assigns the message to this object. The CPushMessage object is passed to content handlers for further processing and storing of the message. To indicate to content handlers whether the message is from WhiteList or from unknown origin, the Push Watcher sets or resets a flag on the CPushMessage object. The content handler should check this flag status by calling CPushMessage::MessageAllowed(). After processing the message, the content handler should set or reset the 8th bit of TMsvEntry::iMtmData1 based on the return value of CPushMessage::MessageAllowed().

The content handler should provide an API to retrieve the status of 8th bit of TMsvEntry::iMtmData1. This API will be used by the user interface to know whether the URI is from an unknown origin.

Content handlers can also retrieve the origin of the message by calling CPushMessage::GetServerAddress() and store it in message store. Content handlers should provide an API for the UI to retrieve the server address for further processing.

[Top]


How to use SI and SL content handler APIs for processing messages

Two new Service Indication (SI) and Service Load (SL) content handler APIs are added to the CSIPushMsgEntry and CSLPushMsgEntry classes, which can be used by the user interface. The following is a short description of the two APIs:

UI developers supporting WAPPush BlackList/WhiteList features should use the relevant content handler APIs to check the status of flags. If a flag is not set, it means that the message is from an unknown origin and should retrieve the origin of the message. If you want to add the retrieved URI to either the BlackList or the WhiteList, then it should be added using the RInetUriList::AddL() function.

[Top]


How to pre-configure URI List for WAPPush Messages

Symbian provides a mechanism for pre-configuring URIs before shipping mobiles to end users. The URI List framework supports pre-configuring both WhiteList and BlackList URIs. This section explains how clients can pre-configure the URI list for WAPPush service messages.

Pre-configuration of the URI List is done by creating an XML data file and installing it in InetURIList server path. The following code sample shows a pre-configuration XML file for WAPPush URIs.

<?xml version="1.0" encoding="UTF-8" ?> 
<!-- 
    Ineturilist pre-configuration File
    Copyright ©) Symbian Software Ltd 2007. All rights reserved.
-- >

<URIList>
 <WAPPush>
  <Whitelist>
   <Record>
     <URI>http://www.google.com/index.html</URI>
     <Permission>EReadOnly</Permission>
     <FavouriteName>Google Home Page</FavouriteName>
   </Record>
   <Record>
     <URI>http://www.symbian.com</URI>
     <Permission>EReadWrite</Permission>
     <FavouriteName>Symbian home page</FavouriteName>
   </Record>
  </Whitelist>
  <Blacklist>
   <Record>
    <URI>http://www.musiconline.com</URI>
    <Permission>EReadOnly</Permission>
    <FavouriteName>Online music</FavouriteName>
   </Record>
  </Blacklist>
 </WAPPush>
</URIList>

See Also

Pre-configuring the URI List based on a DTD file.