×
Namespaces

Variants
Actions

Archived:Notifications API: Setting up support for Notifications UI

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Qt Notification API deprecated.

Article Metadata
Compatibility
Platform(s):
Symbian
Article
Created: isalento (21 Apr 2011)
Last edited: hamishwillee (21 Nov 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.

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 21 November 2013, at 12:52.
69 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×