Namespaces
Variants
Actions

Notifications API: Setting up support for Notifications UI

Jump to: navigation, search
Article Metadata

Article
Created: isalento (21 Apr 2011)
Last edited: hamishwillee (30 Jan 2013)

This article demonstrates how to set up support for using the Notifications UI in your Qt application.

Introduction

The Notifications API lets you add real-time push notifications to your client applications running on Nokia devices. It includes a Service API, which provides access to the Nokia Notification Server through an HTTP REST interface, as well as a Client API, which allows applications on the device to register and receive notifications from the Nokia Notification Server. The Client API is available for Qt on Symbian and MeeGo devices. You can get more information on this Project Notifications UI

Notifications API has a separate Notifications UI application that applications can use a launcher. To use it you must enable it in your application.

iNotificationInterface->setWakeUp(true);
 
iNotificationInterface->setNotificationUi(true, iIconData);

setNotificationUi(true, icondata) requires to have the icon data encoded in Base64 format. Converting the icon data into Base64 string can be done easily as described in the following code snippet.

QImage image;
//load image from resource file
image.load(":/images/icon.png");
 
QByteArray imageData;
QBuffer buffer(&imageData);
 
//Write qimage to buffer in PNG foramt
image.save(&buffer, "PNG");
QString iconData = QString::fromLatin1(imageData.toBase64().data());
 
setNotificationUi(true, iconData);

Notifications UI video

The following video shows how you can use the Notifications UI in your applications.

The media player is loading...

This page was last modified on 30 January 2013, at 05:40.
102 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved