{"_id":"56c41d92bb64720d00552b94","category":{"_id":"56c4184c28bd680d005e7ac7","__v":5,"project":"56bc8e679afb8b0d00d62dcf","pages":["56c41d876063071700500d06","56c41d92bb64720d00552b94","56c41d9e4f0aed1700afabac","56c41dafc0c4630d004e86c3","56c41dbbc0c4630d004e86c5"],"version":"56bc8e689afb8b0d00d62dd2","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-02-17T06:50:52.926Z","from_sync":false,"order":6,"slug":"push","title":"Push"},"project":"56bc8e679afb8b0d00d62dcf","__v":3,"parentDoc":null,"user":"56b98db7bb36440d0001f492","version":{"_id":"56bc8e689afb8b0d00d62dd2","project":"56bc8e679afb8b0d00d62dcf","__v":18,"createdAt":"2016-02-11T13:36:40.146Z","releaseDate":"2016-02-11T13:36:40.146Z","categories":["56bc8e689afb8b0d00d62dd3","56c3c837bc41330d009f25ed","56c3c83e521f350d00d348eb","56c3c8452d97560d00e23cd8","56c3c85234df460d00c2beb8","56c4180d70187b17005f43b4","56c418162d97560d00e23cf6","56c4181cc4796b0d007ef039","56c4182370187b17005f43b5","56c418292e75e01700986052","56c4183328bd680d005e7ac6","56c4183bbb64720d00552b88","56c418414040602b0064cea0","56c4184754b6030d00ec29a1","56c4184c28bd680d005e7ac7","56c4185370187b17005f43b6","56c4185b6063071700500cfc","582a98b6f8c0a0190053d7a5"],"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":"2016-02-17T07:13:22.479Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"WNS is a service for sending push notifications both to Windows Phone and Windows Store apps using a common service endpoint. Compared with MPNS, WNS represents a simpler model for authentication and delivery.\n\nReferring to [How to authenticate with the Windows Push Notification Service ](http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868206.aspx) create an application using the Windows Dev Center.\n\nOnce you have created this app, associate your project in Visual Studio to the app in the store by navigating to *Project > Store > Associate App with the Store... *\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/vAY1iO1bROOYfV0sOwDw_image.png\",\n        \"image.png\",\n        \"709\",\n        \"482\",\n        \"#baa858\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n--------------------------------------\n\nAfter doing this, visit the Windows Dev center and find the Package SID and client secret associated with your app.\nFirst open your app and click \"Services\"\n\n\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/4NnWB6LeTxS6fUEFvEuy_image.png\",\n        \"image.png\",\n        \"757\",\n        \"367\",\n        \"#29a9e1\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n----------------------\n\nThen on the following page, navigate to \"Live Services site\" to retrieve your client secret.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/IcFq5xlSROiM893LAy0U_image.png\",\n        \"image.png\",\n        \"805\",\n        \"169\",\n        \"#994c2c\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n------------------------\n\nFinally, log into the Buddy Dashboard for your app and open the push settings for your app. Click \"Add WNS Package Credentials\", copy your package sid and client secret into the provide fields and click \"OK\" to save.\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/ISQVysHBSZejOc863rGi_image.png\",\n        \"image.png\",\n        \"995\",\n        \"548\",\n        \"#75a2d6\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nYou're all set to send and track remote push notification using Buddy now. Using a given device for push is as simple as dropping the following code into your app.\n\n    PushNotificationChannel channel =  await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();\n    Buddy.SetPushToken(channel.Uri);","excerpt":"","slug":"getting-started-wns","type":"basic","title":"Getting Started - WNS"}

Getting Started - WNS


WNS is a service for sending push notifications both to Windows Phone and Windows Store apps using a common service endpoint. Compared with MPNS, WNS represents a simpler model for authentication and delivery. Referring to [How to authenticate with the Windows Push Notification Service ](http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868206.aspx) create an application using the Windows Dev Center. Once you have created this app, associate your project in Visual Studio to the app in the store by navigating to *Project > Store > Associate App with the Store... * [block:image] { "images": [ { "image": [ "https://files.readme.io/vAY1iO1bROOYfV0sOwDw_image.png", "image.png", "709", "482", "#baa858", "" ] } ] } [/block] -------------------------------------- After doing this, visit the Windows Dev center and find the Package SID and client secret associated with your app. First open your app and click "Services" [block:image] { "images": [ { "image": [ "https://files.readme.io/4NnWB6LeTxS6fUEFvEuy_image.png", "image.png", "757", "367", "#29a9e1", "" ] } ] } [/block] ---------------------- Then on the following page, navigate to "Live Services site" to retrieve your client secret. [block:image] { "images": [ { "image": [ "https://files.readme.io/IcFq5xlSROiM893LAy0U_image.png", "image.png", "805", "169", "#994c2c", "" ] } ] } [/block] ------------------------ Finally, log into the Buddy Dashboard for your app and open the push settings for your app. Click "Add WNS Package Credentials", copy your package sid and client secret into the provide fields and click "OK" to save. [block:image] { "images": [ { "image": [ "https://files.readme.io/ISQVysHBSZejOc863rGi_image.png", "image.png", "995", "548", "#75a2d6", "" ] } ] } [/block] You're all set to send and track remote push notification using Buddy now. Using a given device for push is as simple as dropping the following code into your app. PushNotificationChannel channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync(); Buddy.SetPushToken(channel.Uri);