Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleiOS [Objective-C]

Code Block
[[Appoxee shared] removeTagsFromDevice:@[@"tag1", @"tag2"] withCompletionHandler:^(NSError *appoxeeError, id data) {
 
    if (appoxeeError) {
 
        // check the error domain
    }
 }];

[[Appoxee shared] addTagsToDevice:@[@"tag1", @"tag2"] andRemove:@[@"tagToRemove1", @"tagToRemove2"]  withCompletionHandler:^(NSError *appoxeeError, id data) {
 
    if (appoxeeError) {
 
        // check the error domain
    }
 }];

 [[Appoxee shared] clearTagsCacheWithCompletionhandler:^(NSError *appoxeeError, id data) {
 
    if (!appoxeeError) {
 
        // operation is successful
    }
 }];

[[Appoxee shared] removeTagsFromDevice:@[@"tagToRemove1", @"tagToRemove2"] withCompletionHandler:^(NSError *appoxeeError, id data) {
 
    if (appoxeeError) {
 
        // check the error domain
    }
 }];

[[Appoxee shared] fetchApplicationTags:^(NSError *appoxeeError, id data) {
 
    if (!appoxeeError && [data isKindOfClass:[NSArray class]]) {
 
        NSArray *applicationTags = (NSArray *)data;
    }
 }];

Expand
titleiOS [Swift]

Code Block
Appoxee.shared()?.addTags(toDevice: ["tag1", "tag2"], withCompletionHandler: { (error, data) in
            if (error != nil) {
                //Tag successfully added.
            }
        })
        
        Appoxee.shared()?.addTags(toDevice: ["tag1", "tag2"], andRemove: ["tagToRemove1", "TagToRemove2"], withCompletionHandler: { (error, data) in
            if (error != nil) {
                //Tag successfully added and tags marked for removial are successfuly removed.
            }
        })
        
        Appoxee.shared()?.clearTagsCache(completionhandler: { (error, data) in
            if (error != nil) {
                //Tags cache cleared successfully.
            }
        })
        
        Appoxee.shared()?.removeTags(fromDevice: ["tagToRemove1", "tagToRemove2"], withCompletionHandler: { (error, data) in
            if (error != nil) {
                //Tag successfully removed.
            }
        })
        
        Appoxee.shared()?.fetchDeviceTags({ (error, data) in
            let tags = data as? NSMutableArray
            if (error != nil && tags != nil) {
                //Tags successfully fetched.
            }
        })

Expand
titleAndroid [Java]

Code Block
//Add a tag to device
public RequestStatus addTag(String tag)
  
//use this syntax to add tag
Appoxee.instance().addTag(tag);



//Get all tags apply to the device
public Set<String> getTags()
  
//use this syntax for getting all tags
 Appoxee.instance().getTags()


//Remove tag for device, pass tag into parameter, which you want to remove
public RequestStatus removeTag(String tag){
  
//use this syntax for removing tag
Appoxee.instance().removeTag(removeTag)