{"__v":3,"_id":"5788a4520015df0e00ab1cd7","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":"55b8b82fdec1c9210013cfa1","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":"2016-07-15T08:52:34.757Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Tags\"\n}\n[/block]\n\nWith tags, you can create sets of devices based on different criteria.\n\n**1.** Create a list of tags:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var tagsList = new List<KeyValuePair<string, object>>();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n**2.** Add a tag to the list:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"tagsList.Add(new KeyValuePair<string, object>(\\\"testKey\\\", \\\"testValue\\\"));\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n**3.** Get an instance of NotificationService and send tags!\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"NotificationService service = NotificationService.GetCurrent();\\nservice.SendTag(tagsList,\\n    (obj, status) =>\\n    {\\n        MessageBox.Show(\\\"Tag has been sent!\\\");\\n    },\\n    (obj, error) => MessageBox.Show(\\\"Error while sending the tags: \\\\n\\\" + error.ToString())\\n);\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"User Data\"\n}\n[/block]\nThe app users can send all kinds of custom data to Pushwoosh using the **custom** tag.\n\nGet an instance of NotificationService and collect user data with push notifications (it also comes in the push notifications payload by the way!)\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"NotificationService service = NotificationService.GetCurrent();\\nstring userData = service.UserData;\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Geo zones\"\n}\n[/block]\nYou can send push notifications to users located in a specific area.\n\n**1.** Expand Properties in your Windows Phone application project and open **WMAppManifiest.xml**.\n\nFind checkbox and enable **ID_CAP_LOCATION**. Now, the application can use device location for the GeoZones feature.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<Capabilities>\\n      <Capability Name=\\\"ID_CAP_NETWORKING\\\" />\\n      <Capability Name=\\\"ID_CAP_LOCATION\\\" /> // Enable to use geolocation services\\n      <Capability Name=\\\"ID_CAP_PUSH_NOTIFICATION\\\" />\\n      <Capability Name=\\\"ID_CAP_IDENTITY_DEVICE\\\" />\\n      <Capability Name=\\\"ID_CAP_WEBBROWSERCOMPONENT\\\" />\\n</Capabilities>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]\n**2.** Turning Geo Zones on:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"NotificationService service = NotificationService.GetCurrent();\\nservice.StartGeoLocation();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n**3.** Turning Geo Zones off:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"NotificationService service = NotificationService.GetCurrent();\\nservice.StopGeoLocation();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"In-Apps Tracking\"\n}\n[/block]\nWhen a user buys a product, call the following method:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"service.TrackInAppPurchase(string productId, double price, string currency)\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n* `productId` – product identification (also known as SKU)\n* `price` – product price\n* `currency` – price currency\nExample:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"service.TrackInAppPurchase(\\\"com.example.inapp1\\\", \\\"1.99\\\", \\\"USD\\\");\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"customizing-wp8-sdk","type":"basic","title":"Customizing SDK"}
[block:api-header] { "type": "basic", "title": "Tags" } [/block] With tags, you can create sets of devices based on different criteria. **1.** Create a list of tags: [block:code] { "codes": [ { "code": "var tagsList = new List<KeyValuePair<string, object>>();", "language": "csharp" } ] } [/block] **2.** Add a tag to the list: [block:code] { "codes": [ { "code": "tagsList.Add(new KeyValuePair<string, object>(\"testKey\", \"testValue\"));", "language": "csharp" } ] } [/block] **3.** Get an instance of NotificationService and send tags! [block:code] { "codes": [ { "code": "NotificationService service = NotificationService.GetCurrent();\nservice.SendTag(tagsList,\n (obj, status) =>\n {\n MessageBox.Show(\"Tag has been sent!\");\n },\n (obj, error) => MessageBox.Show(\"Error while sending the tags: \\n\" + error.ToString())\n);", "language": "csharp" } ] } [/block] [block:api-header] { "type": "basic", "title": "User Data" } [/block] The app users can send all kinds of custom data to Pushwoosh using the **custom** tag. Get an instance of NotificationService and collect user data with push notifications (it also comes in the push notifications payload by the way!) [block:code] { "codes": [ { "code": "NotificationService service = NotificationService.GetCurrent();\nstring userData = service.UserData;", "language": "csharp" } ] } [/block] [block:api-header] { "type": "basic", "title": "Geo zones" } [/block] You can send push notifications to users located in a specific area. **1.** Expand Properties in your Windows Phone application project and open **WMAppManifiest.xml**. Find checkbox and enable **ID_CAP_LOCATION**. Now, the application can use device location for the GeoZones feature. [block:code] { "codes": [ { "code": "<Capabilities>\n <Capability Name=\"ID_CAP_NETWORKING\" />\n <Capability Name=\"ID_CAP_LOCATION\" /> // Enable to use geolocation services\n <Capability Name=\"ID_CAP_PUSH_NOTIFICATION\" />\n <Capability Name=\"ID_CAP_IDENTITY_DEVICE\" />\n <Capability Name=\"ID_CAP_WEBBROWSERCOMPONENT\" />\n</Capabilities>", "language": "xml" } ] } [/block] **2.** Turning Geo Zones on: [block:code] { "codes": [ { "code": "NotificationService service = NotificationService.GetCurrent();\nservice.StartGeoLocation();", "language": "csharp" } ] } [/block] **3.** Turning Geo Zones off: [block:code] { "codes": [ { "code": "NotificationService service = NotificationService.GetCurrent();\nservice.StopGeoLocation();", "language": "csharp" } ] } [/block] [block:api-header] { "type": "basic", "title": "In-Apps Tracking" } [/block] When a user buys a product, call the following method: [block:code] { "codes": [ { "code": "service.TrackInAppPurchase(string productId, double price, string currency)", "language": "csharp" } ] } [/block] * `productId` – product identification (also known as SKU) * `price` – product price * `currency` – price currency Example: [block:code] { "codes": [ { "code": "service.TrackInAppPurchase(\"com.example.inapp1\", \"1.99\", \"USD\");", "language": "csharp" } ] } [/block]