{"__v":7,"_id":"55af3ed3826d210d00041e0a","category":{"__v":3,"_id":"5540e63031827a0d007ab215","pages":["55af3e8a826d210d00041e08","55af3ed3826d210d00041e0a","55af4470826d210d00041e15"],"project":"5540ce1b31827a0d007ab1cc","version":"5540ce1c31827a0d007ab1cf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-04-29T14:09:52.700Z","from_sync":false,"order":10,"slug":"windows-8","title":"Windows"},"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-22T06:57:23.220Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[**Download SDK**](https://github.com/Pushwoosh/pushwoosh-windows-sdk)\n[**Download Sample**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Samples/UniversalWin8.1)\n[**SDK API Docs**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Documentation-WNS) \n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"Supports Windows 8.1, Windows Phone 8.1, Windows 10\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"SDK 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}\n[/block]\nTo integrate Pushwoosh into your application, follow the steps below.\n\n**1.** Download our SDK package.\n\n**2.** Add reference to **PushSDK/Project-Win8.1-WNS/PushSDK.winmd** to your project\nOr **PushSDK/Project-Win10-WNS/PushSDK.winmd** if you develop for Windows 10\n\n**3.** In the code add PushSDK namespace: `using PushSDK;`\n\n**4.** Initialize push service with the following code:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"NotificationService service = PushSDK.NotificationService.GetCurrent(\\\"YOUR_PUSHWOOSH_APP_ID\\\");\\nservice.OnPushAccepted += (sender, pushNotification) => {\\n    //code to handle push notification\\n    string pushString = pushNotification.ToString(); //will return json push payload\\n};\\n \\nservice.OnPushTokenReceived += (sender, pushToken) => {\\n    //code to handle push token\\n};\\n \\nservice.OnPushTokenFailed += (sender, errorMessage) => {\\n    //code to handle push subscription failure\\n};\\n \\nservice.SubscribeToPushService();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n**5.** In your **App.xaml.cs** in **OnLaunched** function add:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"protected override void OnLaunched(LaunchActivatedEventArgs args)\\n{\\n    NotificationService.HandleStartPush(args.Arguments);\\n \\n    //other code\\n}\\n\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Important!\",\n  \"body\": \"If you plan to use Toast notifications, make sure Toast notifications are switched on in your application project. Go to the Application UI tab in manifest settings, and set **Toast Capable** to **Yes**. Otherwise, Toast notifications will not work on the device.\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9QYxsItQzqTw3A875YzA_ss1.png\",\n        \"ss1.png\",\n        \"800\",\n        \"700\",\n        \"#7ba1c7\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nPiece of cake?","excerpt":"","slug":"windows-sdk-integration","type":"basic","title":"Windows SDK Integration"}

Windows SDK Integration


[**Download SDK**](https://github.com/Pushwoosh/pushwoosh-windows-sdk) [**Download Sample**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Samples/UniversalWin8.1) [**SDK API Docs**](https://github.com/Pushwoosh/pushwoosh-windows-sdk/tree/master/Documentation-WNS) [block:callout] { "type": "success", "title": "Supports Windows 8.1, Windows Phone 8.1, Windows 10" } [/block] [block:api-header] { "type": "basic", "title": "SDK Integration" } [/block] [block:callout] { "type": "info", "body": "You can use an emulator while working with push notifications." } [/block] To integrate Pushwoosh into your application, follow the steps below. **1.** Download our SDK package. **2.** Add reference to **PushSDK/Project-Win8.1-WNS/PushSDK.winmd** to your project Or **PushSDK/Project-Win10-WNS/PushSDK.winmd** if you develop for Windows 10 **3.** In the code add PushSDK namespace: `using PushSDK;` **4.** Initialize push service with the following code: [block:code] { "codes": [ { "code": "NotificationService service = PushSDK.NotificationService.GetCurrent(\"YOUR_PUSHWOOSH_APP_ID\");\nservice.OnPushAccepted += (sender, pushNotification) => {\n //code to handle push notification\n string pushString = pushNotification.ToString(); //will return json push payload\n};\n \nservice.OnPushTokenReceived += (sender, pushToken) => {\n //code to handle push token\n};\n \nservice.OnPushTokenFailed += (sender, errorMessage) => {\n //code to handle push subscription failure\n};\n \nservice.SubscribeToPushService();", "language": "csharp" } ] } [/block] **5.** In your **App.xaml.cs** in **OnLaunched** function add: [block:code] { "codes": [ { "code": "protected override void OnLaunched(LaunchActivatedEventArgs args)\n{\n NotificationService.HandleStartPush(args.Arguments);\n \n //other code\n}\n", "language": "csharp" } ] } [/block] [block:callout] { "type": "warning", "title": "Important!", "body": "If you plan to use Toast notifications, make sure Toast notifications are switched on in your application project. Go to the Application UI tab in manifest settings, and set **Toast Capable** to **Yes**. Otherwise, Toast notifications will not work on the device." } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/9QYxsItQzqTw3A875YzA_ss1.png", "ss1.png", "800", "700", "#7ba1c7", "" ] } ] } [/block] Piece of cake?