Blackberry - Push Notification Guide
By Technical Support
#26 To integrate Bulkpush into your BlackBerry Phonegap / HTML5 Webworks application you need to do simple following steps:
1. Register for Blackberry Push Notifications here:
2. Download bulkpush.js script from ... ry5-7-HTML and place it in your project folder. Change the YOUR_BULKPUSH_APP_ID in the script to your Bulkpush Application ID from the control panel.
3. Add the bulkpush script to the index.html file before your master script file. Replace ‘YOUR_BULK_PUSH_APP_ID’ with your Bulkpush.

Application ID. You will also need jquery.js. For example:

Code: Select all<script src="" <p=""> </p>
 <script src="bulkpush.js" type="text/javascript"></script>
     Bulkpush.appCode = 'YOUR_BULKPUSH_APP_ID';
<script src="master.js" type="text/javascript"></script>

4. In your onDeviceReady function add the call to the openBISPushListener() function:

Code: Select allfunction onDeviceReady() {

5. In your master javascript file add the following code:
Code: Select allvar port = THE_PORT_FROM_BB_REGISTRATION;
var serverUrl = "";
var max = 100;
var wakeUpPage = "push.html";
function openBISPushListener() {
    try {
        var ops = {port : port, appId : appId, serverUrl :
  serverUrl, wakeUpPage : wakeUpPage, maxQueueCap : max};
        blackberry.push.openBISPushListener(ops, onData,
         onRegister, onSimChange);
    catch (err) {
function onRegister(status) {
    if (status == 0) {
        Bulkpush.register(function(data) {
           alert("Bulkpush register success: "
           + JSON.stringify(data));
                }, function(errorregistration) {
              alert("Couldn't register with Bulkpush"
           +  errorregistration);
    else if (status == 1) {
        alert("push register status network error");
    else if (status == 2) {
        alert("push register status rejected by server");
    else if (status == 3) {
        alert("push register status invalid parameters");
    else if (status == -1) {
        alert("push register status general error");
    else {
        alert("push register status unknown");
function onData(data) {
    alert("Push notifications received. Data is " + blackberry.
    try {
        return 0; //indicate acceptance of payload for reliable push
    catch (err) {
function onSimChange() {
    //handle Sim Card change

That’s it! Easy, isn’t it? You are ready to receive push notifications for your BlackBerry HTML5 Webworks application!

For evaluation server in your client app enter: as a serverUrl (without slash at the end)
In Bulkpush app configuration enter:

The server sends the notification as JSON payload in the following format:
Code: Select all{
  m:'the message itself',
  h: 42, // html page id ex:
  u: '{key: value}',   //user data
  l: ''   //link to redirect the application to