{"__v":4,"_id":"55a90dd5c8bd450d000dd167","category":{"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","_id":"55b9fffdd72d1e1900276a3a","pages":[],"__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-30T10:44:13.323Z","from_sync":false,"order":23,"slug":"triggerio","title":"Trigger.io"},"parentDoc":null,"project":"5540ce1b31827a0d007ab1cc","user":"55a5003a750a9a23005332b6","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-17T14:14:45.572Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Supports iOS, Android\"\n}\n[/block]\n[**Download Module**](https://trigger.io/modules/pushwoosh/)\n[**Download Sample**](https://github.com/Pushwoosh/pushwoosh-trigger-io/tree/master/Sample)\n[**Module API Docs**](https://rawgit.com/Pushwoosh/pushwoosh-trigger-io/master/Documentation/files/module-js.html)\n\n1. Add Pushwoosh module to your app according to the [Configuration for your Modules](https://trigger.io/docs/current/tools/module_config.html) article on Trigger.io.\n\n2. Set up push notifications handler:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"forge.internal.addEventListener(\\\"pushwoosh.pushReceived\\\",\\n    function (notification) {\\n            alert('push received: ' + notification);\\n    }\\n);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n3. Set up push registration handler:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"forge.internal.addEventListener(\\\"pushwoosh.registrationSuccess\\\",\\n    function (status) {\\n            log('registered with token: ' + status['deviceToken']);\\n    }\\n);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n4. Call “onDeviceReady” method (make sure you call this method each time the app starts):\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Replace **ENTER_PUSHWOOSH_APP_ID** with your real Pushwoosh App ID and for Android replace **ENTER_GOOGLE_PROJECT_NUMBER** with your Google Project Number\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"forge.pushwoosh.onDeviceReady({\\\"pw_appid\\\":\\\"ENTER_PUSHWOOSH_APP_ID\\\", \\\"gcm_id\\\":\\\"ENTER_GOOGLE_PROJECT_NUMBER\\\"});\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n5. Register for push notifications:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"forge.pushwoosh.registerDevice();\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nThat’s it!","excerpt":"How to integrate Pushwoosh SDK into your Trigger.io project","slug":"triggerio","type":"basic","title":"Trigger.io"}

Trigger.io

How to integrate Pushwoosh SDK into your Trigger.io project

[block:callout] { "type": "success", "title": "Supports iOS, Android" } [/block] [**Download Module**](https://trigger.io/modules/pushwoosh/) [**Download Sample**](https://github.com/Pushwoosh/pushwoosh-trigger-io/tree/master/Sample) [**Module API Docs**](https://rawgit.com/Pushwoosh/pushwoosh-trigger-io/master/Documentation/files/module-js.html) 1. Add Pushwoosh module to your app according to the [Configuration for your Modules](https://trigger.io/docs/current/tools/module_config.html) article on Trigger.io. 2. Set up push notifications handler: [block:code] { "codes": [ { "code": "forge.internal.addEventListener(\"pushwoosh.pushReceived\",\n function (notification) {\n alert('push received: ' + notification);\n }\n);", "language": "javascript" } ] } [/block] 3. Set up push registration handler: [block:code] { "codes": [ { "code": "forge.internal.addEventListener(\"pushwoosh.registrationSuccess\",\n function (status) {\n log('registered with token: ' + status['deviceToken']);\n }\n);", "language": "javascript" } ] } [/block] 4. Call “onDeviceReady” method (make sure you call this method each time the app starts): [block:callout] { "type": "warning", "body": "Replace **ENTER_PUSHWOOSH_APP_ID** with your real Pushwoosh App ID and for Android replace **ENTER_GOOGLE_PROJECT_NUMBER** with your Google Project Number" } [/block] [block:code] { "codes": [ { "code": "forge.pushwoosh.onDeviceReady({\"pw_appid\":\"ENTER_PUSHWOOSH_APP_ID\", \"gcm_id\":\"ENTER_GOOGLE_PROJECT_NUMBER\"});", "language": "javascript" } ] } [/block] 5. Register for push notifications: [block:code] { "codes": [ { "code": "forge.pushwoosh.registerDevice();", "language": "javascript" } ] } [/block] That’s it!