Trip tag for iOS app

Setting up


Add trip tag
Return tags successfully added (with tag and type only, without source).

RPTag *tagExample = [[RPTag alloc] initWithTag:@"ExampleTag"
                                        source:@"ExampleTagSource"];

[[RPEntry instance].api addTrackTags:@[tagExample]
                                  to:@"TRACK_TOKEN"
                          completion:^(NSArray<RPTag *> * _Nonnull addedTags, NSError * _Nullable error) {
    if (error) {
        NSLog(@"%@", error.localizedDescription);
        return;
    }
    NSLog(@"%@", addedTags);
}];
let tagExample = RPTag(
    tag: "ExampleTag",
    source: "ExampleTagSource"
)

RPEntry.instance.api.addTrackTags([tagExample], to: "TRACK_TOKEN") { addedTags, error in
    if let error {
        print(error.localizedDescription)
        return
    }
            
    print(addedTags)
}

Remove trip tag
Return tags successfully removed (with tag and type only, without source).

RPTag *tagExample = [[RPTag alloc] initWithTag:@"ExampleTag"
                                        source:@"ExampleTagSource"];

[[RPEntry instance].api removeTrackTags:@[tagExample]
                                   from:@"TRACK_TOKEN"
                             completion:^(NSArray<RPTag *> * _Nonnull removedTags, NSError * _Nullable error) {
    if (error) {
        NSLog(@"%@", error.localizedDescription);
        return;
    }
    NSLog(@"%@", removedTags);
}];
let tagExample = RPTag(
    tag: "ExampleTag",
    source: "ExampleTagSource"
)

RPEntry.instance.api.removeTrackTags([tagExample], from: "TRACK_TOKEN") { removedTags, error in
    if let error {
        print(error.localizedDescription)
        return
    }
            
    print(removedTags)
}

Get trip tags

[[RPEntry instance].api getTrackTags:@"TRACK_TOKEN"
                          completion:^(NSArray<RPTag *> * _Nonnull tags, NSError * _Nullable error) {
    if (error) {
        NSLog(@"%@", error.localizedDescription);
        return;
    }
    NSLog(@"%@", tags);
}];
RPEntry.instance.api.getTrackTags("TRACK_TOKEN") { tags, error in
    if let error {
        print(error.localizedDescription)
        return
    }
            
    print(tags)
}