**Download Script **Download Sample

Here’s the simple steps to integrate Pushwoosh plugin into your BlackBerry 10 Webworks 2.0 application:

1. Add the following list of plugins into your project:

com.blackberry.app com.blackberry.identity com.blackberry.invoked com.blackberry.notification com.blackberry.push com.blackberry.ui.dialog com.blackberry.utils
**2.** Add the *http://cp.pushwoosh.com* access url into your **config.xml**:
**3.** Add the following script to the **config.xml**:
APPLICATION bb.action.PUSH application/vnd.push // GENERATE is the unique identification value of your application APPLICATION bb.action.OPEN text/plain
In the code above you have to put any unique identification value of the app instead of the “GENERATE”
**4.** Add the following permissions:
read_device_identifying_information _sys_use_consumer_push run_when_backgrounded post_notification
**5.** Add the following libraries to your project:

Download our plugin (pushwoosh.js) here and place it in “js” subfolder (ex: “js/pushwoosh.js”).

Download jQuery library and place it in “js” subfolder (ex: “js/jquery-1.10.2.min.js”).

6. Add the following script to the index.html:

NOTE:

– We recommend adding this script inside the body tag in the very end of it;

– You can use the different jQuery library. You can download them here;

– You don’t have to look for the cordova.js anywhere – everything will be done by the web worker builder.

**7.** Change the following application settings in the **pushwoosh.js** with app setting you receive from BlackBerry:
var config = { ops : { invokeTargetId : "GENERATE.invoke.push", // the same id value that you used in the config.xml appId : "XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", // AppId from the configuration email you receive from BlackBerry ppgUrl : "http://cpXXXX.pushapi.eval.blackberry.com" // ppgUrl from the configuration email you receive from BlackBerry }, pushwooshAppId : "XXXXX-XXXXX", // Pushwoosh Application Code invokeTargetIdOpen : "GENERATE.invoke.open" // the same id value that you used in the config.xml };
Make sure PGG Url is HTTP. If you enter it as HTTPS push notifications channel won’t subscribe.