Blackberry push

There are two kinds of blackberry push: RIM push and PAP push. You need MDS server to simulate your push application using Blackberry simulator.
This code is a sample of Blackberry push enabled with Webworks environment:


<!DOCTYPE HTML PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”>
<h5>sample push application by</h5>
<script type=”text/javascript”>
var port = 100;
function subscribe() {
blackberry.push.openPushListener(function(data) {
if (data != null) {
var text = blackberry.utils.blobToString(data.payload);
alert(“You have a push message:” + text );
} else {
alert(“no data from push”);
}, port);
alert(“push Listening has just started”);
function unsubscribe() {
alert(“Push listening has stopped”);
<meta name=”viewport” id=”viewport” content=”initial-scale=1.0,user-scalable=no” />
<title>Job Seeker</title>
<button id=”btnsubscribe” onclick=”subscribe()”>Subscribe</button>
<button id=”btnunsubscribe” onclick=”unsubscribe()”>Un Subscribe</button>

In your config.xml , add these features in your widget permission: blackberry.push, blackberry.system, blackberry.utils


About abunajiyah
A Programmer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: