The Nokia Notifications API enables you to implement Push notifications in your Nokia X apps. Nokia Notifications consists of a client API and a server API. If you’re already using Google Cloud Messaging in an Android app, you can port or even add Nokia Notifications to the same code base and APK. In this webinar, we’ll show you how to use Nokia Notifications in your Nokia X apps and walk you through example code provided in the Nokia X SDK.
3. • Nokia Notifications enables real-time push
notifications to your application running on Nokia
X software platform.
• Notification is a message that is sent from a
specific notification service to an application
installed on the device.
• Nokia Notifications API consists of two parts:
Nokia Notifications Client API (Client API) is the
Java API enabling an application to register to a
service, and receive and handle notifications.
• Nokia Notifications Service API (Service API)
defines the communication method between a
3rd party service and Nokia Notifications service.
NOKIA NOTIFICATIONS (I)
4. • The process of receiving notifications is straightforward. The
application, implementing Client API, registers itself for
receiving notifications by sending service specific sender
identification (sender ID) to Nokia Notifications server.
• Nokia Notifications server responds by sending a device
specific registration identification (registration ID, RID) to the
client device.
• The client application then provides the RID for the 3rd party
server, which implements Service API.
• Finally, the 3rd party server can send notifications, via Nokia
Notifications server, for the devices whose registration ID it
knows. It is the responsibility of the developer to implement
a) client application with Client API and b) server with
Service API.
NOKIA NOTIFICATIONS (II)
6. NOKIANOTIFICATIONSAPI MATCHING THE C2DM / GCM
• Client API:
• Matching push notification APIs
• Intent based API to:
• register/unregister in device to receive notifications and
• receive notifications with payload
• Nokia Notifications helper library to use the Intent based API
• Registering the application: com.nokia.pushnotifications.REGISTER
• Unregistering the application: com.nokia.pushnotifications.UNREGISTER
• Receiving registration ID: com.nokia.pushnotifications.intent.REGISTRATION
• Receiving notifications with payload: com.nokia.pushnotifications.RECEIVE
• Server API:
• Support for 4kB payload
• 100 message buffer in server + notification of flushing the buffer
• HTTP API that supports JSON (matching the GCM server API)
• dry_run parameter allowing developers to test their request without actually sending a message
7. NOT SUPPORTED BY NOKIANOTIFICATIONSAPI
• Service statistics for developer
• User specific notifications, which provides a mapping between a user and instances of an app running on multiple
devices owned by the user
• Receiving messages from multiple senders, e.g. a news application receiving messages from multiple sources
• Bidirectional XMPP protocol based communication (new in CCS)
• Some optional server API parameters:
• restricted_package_name: A string containing the package name of your application. When set, the messages
will only be sent to registration IDs that match the package name.
• collapse_key: For collapsing group of the notifications
• notification_key: For sending the notification to multiple devices of the one user
• delay_while_idle: To prevent the notification sending to the idle device. The notification is delivered next time,
when the device is active.
9. PORTINGAPPROACHES FOR THE CLIENTAPP (I)
Before you can start using Nokia Notifications API, you need to register a Sender ID from Nokia Notification developer
console. Porting your existing GCM application to use Nokia Notifications can be done roughly by two different
approaches:
1. If your application utilises the GCM helper library (gcm.jar), you can take in use the Nokia Notifications helper library
which implements a similar API.
2. If your application utilises C2DM/GCM Intent API, you need to replace the namespaces of intent actions and
permissions to match those defined in Nokia Notifications API.
You can also abstract the notifications specific code in your app or use an adaptive, dynamic approach to incorporate
both Google services and Nokia Notifications in a single application.
10. PORTINGAPPROACHES FOR THE CLIENTAPP (II)
Despite the approach you choose, any C2DM or GCM application that is modified to use Nokia Notifications needs
following basic changes:
1. Change sender ID from Google API project number or account name to Nokia Notifications sender ID
• To acquire the Nokia Notifications Sender ID you need a Nokia Developer Account to access the Nokia
Notifications developer console.
2. Make sure that application's own service knows how to send notifications to applications associated with a specific
Nokia Notifications registration IDs
• Your service has to use the Nokia Notifications Server API to send push notifications to devices using Nokia
Notifications so you should either:
• modify the service to only use the Nokia Notifications Server API, or
• add some metadata to the registration ID so that the service knows which service each ID is associated
with.
11. PORTING THE SERVER SIDE IMPLEMENTATION
Porting the server implementation is quite straightforward. The minimum set of changes include:
Changing the API key and
URI to https://nnapi.ovi.com/nnapi/2.0/send
13. Nokia X website
http://developer.nokia.com/nokia-x
Code samples
http://developer.nokia.com/resources/code-sample/capture-the-flag-v1.0
Capture the Flag game is a Nokia example application demonstrating the use of Nokia services on Nokia X software platform:
HERE Maps, Nokia Notifications and Nokia In-App Payment.
Nokia X Tutorials (video clips)
http://www.youtube.com/playlist?list=PLuc1ZjZXgzePUQmR9X8p59pe629668ACy
DEVELOPER RESOURCES