--- title: "Tags" slug: "mapp-engage-ios-sdk-tags" updated: 2026-05-07T09:31:42Z published: 2026-05-07T09:31:42Z canonical: "docs.mapp.com/mapp-engage-ios-sdk-tags" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.mapp.com/llms.txt > Use this file to discover all available pages before exploring further. # Tags ## Overview Tags help categorize devices and users for segmentation and targeted messaging. The Mapp Engage iOS SDK exposes two distinct tag scopes: - **Device tags** — tags assigned to the current device. Use these to segment users. - **Application tags** — the whitelist of tag names defined for the application as a whole. Use this to discover which tag names are valid before assigning them. --- ## Use Case 1. **Purpose**: - Label devices with specific attributes (for example, `"NewsletterSubscriber"`, `"GamingEnthusiast"`). - Drive dynamic segmentation for personalized notifications. 2. **Benefits**: - Improved targeting for push and inbox messages. - Simpler user management and reporting. --- ## Implementation Details All tag completion handlers use the standard `AppoxeeCompletionHandler` signature: `^(NSError * _Nullable error, id _Nullable data)`. ### Add tags to the device **Swift** ```swift Appoxee.shared()?.addTags(toDevice: ["NewsletterSubscriber", "FrequentBuyer"]) { error, data in    if error == nil { print("Tags added.") } } ``` **Objective-C** ```objectivec [[Appoxee shared] addTagsToDevice:@[@"NewsletterSubscriber", @"FrequentBuyer"]            withCompletionHandler:^(NSError * _Nullable error, id _Nullable data) {    if (!error) {        NSLog(@"Tags added.");    } }]; ``` ### Remove tags from the device **Swift** ```swift Appoxee.shared()?.removeTags(fromDevice: ["NewsletterSubscriber"]) { error, data in    if error == nil { print("Tags removed.") } } ``` **Objective-C** ```objectivec [[Appoxee shared] removeTagsFromDevice:@[@"NewsletterSubscriber"]                 withCompletionHandler:^(NSError * _Nullable error, id _Nullable data) {    if (!error) {        NSLog(@"Tags removed.");    } }]; ``` ### Add and remove tags in a single call **Swift** ```swift Appoxee.shared()?.addTags(toDevice: ["VIP"], andRemove: ["Trial"]) { error, data in    if error == nil { print("Tags updated atomically.") } } ``` **Objective-C** ```objectivec [[Appoxee shared] addTagsToDevice:@[@"VIP"]                         andRemove:@[@"Trial"]            withCompletionHandler:^(NSError * _Nullable error, id _Nullable data) {    if (!error) {        NSLog(@"Tags updated atomically.");    } }]; ``` ### Fetch device tags Returns the tags currently assigned to this device. **Swift** ```swift Appoxee.shared()?.fetchDeviceTags { error, data in    if error == nil, let tags = data as? [String] {        print("Device tags: \(tags)")    } } ``` **Objective-C** ```objectivec [[Appoxee shared] fetchDeviceTags:^(NSError * _Nullable error, id _Nullable data) {    if (!error) {        NSArray *tags = (NSArray *)data;        NSLog(@"Device tags: %@", tags);    } }]; ``` ### Fetch application tags (whitelist) Returns the tag names that are configured at the application level. Use this list to validate tag names before assigning them to a device. **Swift** ```swift Appoxee.shared()?.fetchApplicationTags { error, data in    if error == nil, let whitelist = data as? [String] {        print("Application tags: \(whitelist)")    } } ``` **Objective-C** ```objectivec [[Appoxee shared] fetchApplicationTags:^(NSError * _Nullable error, id _Nullable data) {    if (!error) {        NSArray *whitelist = (NSArray *)data;        NSLog(@"Application tags: %@", whitelist);    } }]; ``` ### Clear the tags cache Forces the next fetch to hit the server. **Swift** ```swift Appoxee.shared()?.clearTagsCache { error, data in    if error == nil { print("Tags cache cleared.") } } ``` **Objective-C** ```objectivec [[Appoxee shared] clearTagsCacheWithCompletionhandler:^(NSError * _Nullable error, id _Nullable data) {    if (!error) {        NSLog(@"Tags cache cleared.");    } }]; ``` > [!WARNING] > Warning: > > The Objective-C selector exported by the SDK is `clearTagsCacheWithCompletionhandler:` — note the lowercase `h` in `Completionhandler`. Use the symbol exactly as shown in Objective-C. > [!NOTE] > Keep in mind: > > - Only tag names defined at the application level (`fetchApplicationTags:`) can be assigned to a device. Adding an unknown tag is a no-op or error depending on backend configuration. > - Use consistent and descriptive tag names so segmentation rules stay legible. > - Test add, remove, and retrieve flows together — including the combined `addTagsToDevice:andRemove:withCompletionHandler:` form.