{"__v":7,"_id":"55ae2c822723e51900898fa2","category":{"__v":4,"_id":"55ae1abe8576b92300291c80","pages":["55ae1b43f302af23000ac0ab","55ae240f2723e51900898f96","55ae2c822723e51900898fa2","55ae2eda8576b92300291caf"],"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-21T10:11:10.515Z","from_sync":false,"order":6,"slug":"blackberry-10","title":"BlackBerry 10"},"parentDoc":null,"project":"5540ce1b31827a0d007ab1cc","user":"55a79a4d4a33f92b00b7a111","version":{"__v":31,"_id":"5540ce1c31827a0d007ab1cf","project":"5540ce1b31827a0d007ab1cc","createdAt":"2015-04-29T12:27:08.390Z","releaseDate":"2015-04-29T12:27:08.390Z","categories":["5540ce1c31827a0d007ab1d0","5540d91bbb9e762d00f594ad","5540e5f131827a0d007ab212","5540e5febb9e762d00f594d3","5540e61331827a0d007ab213","5540e6195cf9682100d61afa","5540e62631827a0d007ab214","5540e63031827a0d007ab215","5540e63531827a0d007ab216","5540e63e5cf9682100d61afc","5540e6445cf9682100d61afd","5540e64a5cf9682100d61afe","55a4ff5b2e70c0250038050f","55acb28318eefd0d0071d504","55ae1abe8576b92300291c80","55ae453ef302af23000ac109","55af586d555b900d0036d296","55af91dac8a85321007a53c3","55b9fee204775a2f00628071","55b9ff0e04775a2f00628072","55b9ff4604775a2f00628073","55b9ff5fd72d1e1900276a38","55b9ff7f04775a2f00628074","55b9ff90eb08801900f833e5","55b9ffa5d72d1e1900276a39","55b9ffca04775a2f00628075","55b9fffdd72d1e1900276a3a","56bc2f033ee9e70d008b46af","56c2f6efbbf9ec2d00e0fe4f","57595bbb18760817001e8bbe","57d8d9793916800e003dde53"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-21T11:26:58.917Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"[**Download Script**](https://github.com/Pushwoosh/pushwoosh-blackberry-sdk/tree/master/Blackberry10-HTML)\n[**Download Sample**](https://github.com/Pushwoosh/pushwoosh-blackberry-sdk/tree/master/Samples/Blackberry-10-HTML5-Webworks)\n\nHere are a few simple steps to integrate Pushwoosh plugin into your BlackBerry 10 Webworks 2.0 application:\n\n**1.** Add the following list of plugins into your project:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"com.blackberry.app\\ncom.blackberry.identity\\ncom.blackberry.invoked\\ncom.blackberry.notification\\ncom.blackberry.push\\ncom.blackberry.ui.dialog\\ncom.blackberry.utils\",\n      \"language\": \"java\"\n    }\n  ]\n}\n[/block]\n**2.** Add the *http://cp.pushwoosh.com* access url into your **config.xml**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<access uri=\\\"http://cp.pushwoosh.com\\\" subdomains=\\\"true\\\" />\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n**3.** Add the following script to **config.xml**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<rim:invoke-target id=\\\"GENERATE.invoke.push\\\">\\n    <type>APPLICATION</type>\\n    <filter>\\n        <action>bb.action.PUSH</action>\\n        <mime-type>application/vnd.push</mime-type>\\n    </filter>\\n</rim:invoke-target>\\n \\n<rim:invoke-target id=\\\"GENERATE.invoke.open\\\">   // GENERATE is the unique identification value of your application \\n    <type>APPLICATION</type>\\n    <filter>\\n        <action>bb.action.OPEN</action>\\n        <mime-type>text/plain</mime-type>\\n    </filter>\\n</rim:invoke-target>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"In the code above replace “GENERATE” with a unique identification value of the app.\"\n}\n[/block]\n**4.** Add the following permissions:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<rim:permissions>\\n    <rim:permit>read_device_identifying_information</rim:permit>\\n    <rim:permit system=\\\"true\\\">_sys_use_consumer_push</rim:permit>\\n    <rim:permit>run_when_backgrounded</rim:permit>\\n    <rim:permit>post_notification</rim:permit>\\n</rim:permissions>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n**5.** Add the following libraries to your project:\n\nDownload our plugin (pushwoosh.js) [here](https://github.com/Pushwoosh/pushwoosh-blackberry-sdk/tree/master/Blackberry10-HTML) and place it in “js” subfolder (ex: “js/pushwoosh.js”).\n\nDownload jQuery library and place it in “js” subfolder (ex: “js/jquery-1.10.2.min.js”).\n\n**6.** Add the following script to the **index.html**:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<script type=\\\"text/javascript\\\" src=\\\"cordova.js\\\"></script>\\n<script type=\\\"text/javascript\\\" src=\\\"js/jquery-1.10.2.min.js\\\"></script>\\n<script type=\\\"text/javascript\\\" src=\\\"js/pushwoosh.js\\\"></script>\\n<script type=\\\"text/javascript\\\">\\n    document.addEventListener('deviceready', function ondeviceready() {                 \\n        pushwoosh.register(function(pushObject){\\n            //This is a push handler function! Let's show alert with push content!\\n            alert(\\\"push: \\\" + JSON.stringify(pushObject));\\n        });     \\n    }, false);\\n</script>\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"NOTE:\\n- We recommend adding this script inside the **body** tag in the very end;\\n- You can use different jQuery libraries, download them [here](http://jquery.com/download/);\\n- Don't bother looking for **cordova.js** – the **web worker builder** will do everything.\"\n}\n[/block]\n**7.** Change the following application settings in pushwoosh.js with settings you receive from BlackBerry:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var config = {\\n    ops : {\\n        invokeTargetId : \\\"GENERATE.invoke.push\\\", // use the same id value as in config.xml\\n        appId : \\\"XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\\\", // AppId from the Blackberry configuration email \\n        ppgUrl : \\\"http://cpXXXX.pushapi.eval.blackberry.com\\\" // ppgUrl from the BlackBerry configuration email \\n    },\\n    pushwooshAppId : \\\"XXXXX-XXXXX\\\", // Pushwoosh Application Code\\n    invokeTargetIdOpen : \\\"GENERATE.invoke.open\\\" // use the same id value as in config.xml\\n};\\n\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Make sure PGG Url is **HTTP**.\\n\\n**HTTPS** push notifications channel won’t be able to subscribe.\"\n}\n[/block]","excerpt":"HTML5 / Webworks 2.0 Integration Guide","slug":"html5-webworks-bb10","type":"basic","title":"HTML5 / Webworks"}

HTML5 / Webworks

HTML5 / Webworks 2.0 Integration Guide

[**Download Script**](https://github.com/Pushwoosh/pushwoosh-blackberry-sdk/tree/master/Blackberry10-HTML) [**Download Sample**](https://github.com/Pushwoosh/pushwoosh-blackberry-sdk/tree/master/Samples/Blackberry-10-HTML5-Webworks) Here are a few simple steps to integrate Pushwoosh plugin into your BlackBerry 10 Webworks 2.0 application: **1.** Add the following list of plugins into your project: [block:code] { "codes": [ { "code": "com.blackberry.app\ncom.blackberry.identity\ncom.blackberry.invoked\ncom.blackberry.notification\ncom.blackberry.push\ncom.blackberry.ui.dialog\ncom.blackberry.utils", "language": "java" } ] } [/block] **2.** Add the *http://cp.pushwoosh.com* access url into your **config.xml**: [block:code] { "codes": [ { "code": "<access uri=\"http://cp.pushwoosh.com\" subdomains=\"true\" />", "language": "xml" } ] } [/block] **3.** Add the following script to **config.xml**: [block:code] { "codes": [ { "code": "<rim:invoke-target id=\"GENERATE.invoke.push\">\n <type>APPLICATION</type>\n <filter>\n <action>bb.action.PUSH</action>\n <mime-type>application/vnd.push</mime-type>\n </filter>\n</rim:invoke-target>\n \n<rim:invoke-target id=\"GENERATE.invoke.open\"> // GENERATE is the unique identification value of your application \n <type>APPLICATION</type>\n <filter>\n <action>bb.action.OPEN</action>\n <mime-type>text/plain</mime-type>\n </filter>\n</rim:invoke-target>", "language": "xml" } ] } [/block] [block:callout] { "type": "info", "body": "In the code above replace “GENERATE” with a unique identification value of the app." } [/block] **4.** Add the following permissions: [block:code] { "codes": [ { "code": "<rim:permissions>\n <rim:permit>read_device_identifying_information</rim:permit>\n <rim:permit system=\"true\">_sys_use_consumer_push</rim:permit>\n <rim:permit>run_when_backgrounded</rim:permit>\n <rim:permit>post_notification</rim:permit>\n</rim:permissions>", "language": "xml" } ] } [/block] **5.** Add the following libraries to your project: Download our plugin (pushwoosh.js) [here](https://github.com/Pushwoosh/pushwoosh-blackberry-sdk/tree/master/Blackberry10-HTML) 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**: [block:code] { "codes": [ { "code": "<script type=\"text/javascript\" src=\"cordova.js\"></script>\n<script type=\"text/javascript\" src=\"js/jquery-1.10.2.min.js\"></script>\n<script type=\"text/javascript\" src=\"js/pushwoosh.js\"></script>\n<script type=\"text/javascript\">\n document.addEventListener('deviceready', function ondeviceready() { \n pushwoosh.register(function(pushObject){\n //This is a push handler function! Let's show alert with push content!\n alert(\"push: \" + JSON.stringify(pushObject));\n }); \n }, false);\n</script>", "language": "javascript" } ] } [/block] [block:callout] { "type": "info", "body": "NOTE:\n- We recommend adding this script inside the **body** tag in the very end;\n- You can use different jQuery libraries, download them [here](http://jquery.com/download/);\n- Don't bother looking for **cordova.js** – the **web worker builder** will do everything." } [/block] **7.** Change the following application settings in pushwoosh.js with settings you receive from BlackBerry: [block:code] { "codes": [ { "code": "var config = {\n ops : {\n invokeTargetId : \"GENERATE.invoke.push\", // use the same id value as in config.xml\n appId : \"XXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\", // AppId from the Blackberry configuration email \n ppgUrl : \"http://cpXXXX.pushapi.eval.blackberry.com\" // ppgUrl from the BlackBerry configuration email \n },\n pushwooshAppId : \"XXXXX-XXXXX\", // Pushwoosh Application Code\n invokeTargetIdOpen : \"GENERATE.invoke.open\" // use the same id value as in config.xml\n};\n", "language": "javascript" } ] } [/block] [block:callout] { "type": "warning", "body": "Make sure PGG Url is **HTTP**.\n\n**HTTPS** push notifications channel won’t be able to subscribe." } [/block]