{"_id":"5784a94e06f5060e001e0e9a","project":"56cecbdb44c5700b0095c03a","githubsync":"","parentDoc":null,"user":"56cecbb2e50c9c1b008303eb","category":{"_id":"56d3693d1660770b0008115a","pages":["56e51ce64ddf0b0e004afbbc","56e51d092d90970e00af1b1a","56e69b0c00ea361700d4fa78","56ea7bdfcf35bf0e00adb91d"],"version":"56cecbdc44c5700b0095c03d","__v":4,"project":"56cecbdb44c5700b0095c03a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-28T21:40:13.300Z","from_sync":false,"order":2,"slug":"ios","title":"iOS"},"version":{"_id":"56cecbdc44c5700b0095c03d","project":"56cecbdb44c5700b0095c03a","__v":10,"createdAt":"2016-02-25T09:39:40.121Z","releaseDate":"2016-02-25T09:39:40.121Z","categories":["56cecbdc44c5700b0095c03e","56d1d2c05ad7ad0b00b7e809","56d1d2fa5ad7ad0b00b7e80a","56d369331660770b00081159","56d3693d1660770b0008115a","56e5361e7990160e002e3fbc","56e5362775eb791700a9c4d2","57a9030947f2f419009188d4","57b4705ee9e4c60e00f6f4c3","5828f5b04774ab0f005179a2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":1,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-12T08:24:46.469Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"User segmentation enables you to send notifications to a specific audience. For example, if you have a news app, you can let your users specific content categories that interest them. So if one marked \"Sports\" you can tag it with this name, and later send a sport specific notification, just to those users who marked this category.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Adding tags for a device\"\n}\n[/block]\nIn order to add tag for a device, add the following code at the relevant place:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PATag *tag = [[PATag alloc] initWithName::::at:::\\\"sports_fan\\\" andValue:YES];\\n[PushApps addTag:tag];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Tags are case insensitive\",\n  \"body\": \"Please notice that tags should be lowercase only (but can contains numbers, signs or any other characters).\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Removing tags for a device\"\n}\n[/block]\nIn order to remove tag for a device, add the following code at the relevant place:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[PushApps removeTag:@\\\"sports_fan\\\"];\",\n      \"language\": \"objectivec\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"user-segmentation-1","type":"basic","title":"User Segmentation"}
User segmentation enables you to send notifications to a specific audience. For example, if you have a news app, you can let your users specific content categories that interest them. So if one marked "Sports" you can tag it with this name, and later send a sport specific notification, just to those users who marked this category. [block:api-header] { "type": "basic", "title": "Adding tags for a device" } [/block] In order to add tag for a device, add the following code at the relevant place: [block:code] { "codes": [ { "code": "PATag *tag = [[PATag alloc] initWithName:@\"sports_fan\" andValue:YES];\n[PushApps addTag:tag];", "language": "objectivec" } ] } [/block] [block:callout] { "type": "warning", "title": "Tags are case insensitive", "body": "Please notice that tags should be lowercase only (but can contains numbers, signs or any other characters)." } [/block] [block:api-header] { "type": "basic", "title": "Removing tags for a device" } [/block] In order to remove tag for a device, add the following code at the relevant place: [block:code] { "codes": [ { "code": "[PushApps removeTag:@\"sports_fan\"];", "language": "objectivec" } ] } [/block]