{"__v":13,"_id":"55ae4637f302af23000ac10c","category":{"__v":5,"_id":"5540e61331827a0d007ab213","pages":["55ae4637f302af23000ac10c","55ae4d568576b92300291cfc","55ae50c8826d210d00041bdb","55ae54b58576b92300291d17","55ae564931712a31008765d6"],"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T14:09:23.994Z","from_sync":false,"order":7,"slug":"windows-phone","title":"Windows Phone"},"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-21T13:16:39.685Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"[**Download SDK**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/PushSDK/WP8-MPNS)\n[**WP8 Sample**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Samples/WP8)\n[**SDK API Docs**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Documentation-MPNS) \n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"SDK Integration\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Integration guide for Windows Phone 8.1 and upper versions\",\n  \"body\": \"If your Windows Phone version is 8.1, please use this [**guide**](http://docs.pushwoosh.com/docs/windows-8-configuration) for the integration.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"You can use an emulator while working with push notifications.\",\n  \"title\": \"\"\n}\n[/block]\n**1.** Download our SDK package. If you develop for **Windows Phone 8**, add reference to **PushSDK/WP8-MPNS/Release/PushSDK.dll** to your project.\n\n**2.** In the code add the PushSDK namespace: `using PushSDK;`\n\n**3.** Initialize push service with the following code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"NotificationService service = NotificationService.GetCurrent(\\\"YOUR_PUSHWOOSH_APP_ID\\\",  \\\"AUTH_SERVICE_NAME_OR_NULL\\\", null);\\nservice.OnPushTokenReceived += (sender, pushToken) => {\\n    //code to handle push token\\n};\\n \\nservice.OnPushTokenFailed += (sender, error) => {\\n    //code to handle push subscription failure\\n};\\n \\nservice.OnPushAccepted += (sender, pushNotification) => {\\n    //code to handle push notification\\n};\\n \\nservice.SubscribeToPushService();\",\n      \"language\": \"cplusplus\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"* **First parameter** – identifier of your application in Pushwoosh (required);\\n* **Second parameter** – name of service for authenticated pushes: pass **null** if you don’t have one set-up;\\n* **Third parameter** – list of the trusted servers that can send Tile notifications (required for receiving Tile notifications).\"\n}\n[/block]\n**4.** Make sure you have enabled **ID_CAP_PUSH_NOTIFICATION** and **ID_CAP_IDENTITY_DEVICE** in your project. Expand **Properties** folder in your Windows Phone application project and open **WMAppManifiest.xml**.\n\nEnable **ID_CAP_PUSH_NOTIFICATION** and **ID_CAP_IDENTITY_DEVICE** capabilities by checking the corresponding checkbox.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<Capabilities>\\n      <Capability Name=\\\"ID_CAP_IDENTITY_DEVICE\\\" />\\n      <Capability Name=\\\"ID_CAP_PUSH_NOTIFICATION\\\" /> // Enable to allow push notifications for your application\\n      <Capability Name=\\\"ID_CAP_WEBBROWSERCOMPONENT\\\" />\\n</Capabilities>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\nThat’s it! Easy, isn’t it?","excerpt":"How to integrate Pushwoosh into your Windows Phone application","slug":"native-windows-phone-sdk","type":"basic","title":"Windows Phone SDK"}

Windows Phone SDK

How to integrate Pushwoosh into your Windows Phone application

[**Download SDK**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/PushSDK/WP8-MPNS) [**WP8 Sample**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Samples/WP8) [**SDK API Docs**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Documentation-MPNS) [block:api-header] { "type": "basic", "title": "SDK Integration" } [/block] [block:callout] { "type": "warning", "title": "Integration guide for Windows Phone 8.1 and upper versions", "body": "If your Windows Phone version is 8.1, please use this [**guide**](http://docs.pushwoosh.com/docs/windows-8-configuration) for the integration." } [/block] [block:callout] { "type": "info", "body": "You can use an emulator while working with push notifications.", "title": "" } [/block] **1.** Download our SDK package. If you develop for **Windows Phone 8**, add reference to **PushSDK/WP8-MPNS/Release/PushSDK.dll** to your project. **2.** In the code add the PushSDK namespace: `using PushSDK;` **3.** Initialize push service with the following code: [block:code] { "codes": [ { "code": "NotificationService service = NotificationService.GetCurrent(\"YOUR_PUSHWOOSH_APP_ID\", \"AUTH_SERVICE_NAME_OR_NULL\", null);\nservice.OnPushTokenReceived += (sender, pushToken) => {\n //code to handle push token\n};\n \nservice.OnPushTokenFailed += (sender, error) => {\n //code to handle push subscription failure\n};\n \nservice.OnPushAccepted += (sender, pushNotification) => {\n //code to handle push notification\n};\n \nservice.SubscribeToPushService();", "language": "cplusplus" } ] } [/block] [block:callout] { "type": "info", "body": "* **First parameter** – identifier of your application in Pushwoosh (required);\n* **Second parameter** – name of service for authenticated pushes: pass **null** if you don’t have one set-up;\n* **Third parameter** – list of the trusted servers that can send Tile notifications (required for receiving Tile notifications)." } [/block] **4.** Make sure you have enabled **ID_CAP_PUSH_NOTIFICATION** and **ID_CAP_IDENTITY_DEVICE** in your project. Expand **Properties** folder in your Windows Phone application project and open **WMAppManifiest.xml**. Enable **ID_CAP_PUSH_NOTIFICATION** and **ID_CAP_IDENTITY_DEVICE** capabilities by checking the corresponding checkbox. [block:code] { "codes": [ { "code": "<Capabilities>\n <Capability Name=\"ID_CAP_IDENTITY_DEVICE\" />\n <Capability Name=\"ID_CAP_PUSH_NOTIFICATION\" /> // Enable to allow push notifications for your application\n <Capability Name=\"ID_CAP_WEBBROWSERCOMPONENT\" />\n</Capabilities>", "language": "xml" } ] } [/block] That’s it! Easy, isn’t it?