You can set tags to Incoming then all tracks received after installing TAGS will be marked with these tags. Here the binding is done on a person (deviceToken). You can add, remove, and get a list of installed tags on IncomingTags for enriched trips these are the same tags as on Incoming but already linked to a specific track. You can also delete, add, and get Tags already linked to a specific track.
Added new RPTagsServerStateDelegate for online and offline operation status logging
RPTagStatus in this protocol
typedef NS_ENUM(NSUInteger, RPTagStatus) {
SUCCESS, // success for add or delete
OFFLINE, // app in offline and operation saved in local database
ERROR_WRONG_TIME, // operation canceled by server with wrong time(time from future)
ERROR_TAG_OPERATION // operation canceled by server as duplicated or incorrect
};
Usage example:
@interface MyListener () <RPTagsServerStateDelegate> {}
@end
@implementation MyListener
- (instancetype)init {
self = [super init];
if (self) {
[RPEntry instance].tagStateDelegate = self;
}
return self;
}
- (void)addTag:(RPTagStatus)status tag:(RPTag *)tag timestamp:(NSInteger)timestamp {
NSString *str = @"";
switch (status) {
case SUCCESS:
str = @"success for add or delete";
break;
case OFFLINE:
str = @"app in offline and operation saved in local database";
break;
case ERROR_WRONG_TIME:
str = @"operation canceled by server with wrong time(time from future)";
break;
case ERROR_TAG_OPERATION:
str = @"operation canceled by server as duplicated or incorrect";
break;
default:
break;
}
NSLog(@"%@ - %@ - %ld", str, tag.toJSON, timestamp);
}
- (void)deleteTag:(RPTagStatus)status tag:(RPTag *)tag timestamp:(NSInteger)timestamp {
NSString *str = @"";
switch (status) {
case SUCCESS:
str = @"success for add or delete";
break;
case OFFLINE:
str = @"app in offline and operation saved in local database";
break;
case ERROR_WRONG_TIME:
str = @"operation canceled by server with wrong time(time from future)";
break;
case ERROR_TAG_OPERATION:
str = @"operation canceled by server as duplicated or incorrect";
break;
default:
break;
}
NSLog(@"%@ - %@ - %ld", str, tag.toJSON, timestamp);
}
- (void)getTags:(RPTagStatus)status tags:(id)tags timestamp:(NSInteger)timestamp {
NSString *str = @"";
switch (status) {
case SUCCESS:
str = @"success for add or delete";
break;
case OFFLINE:
str = @"app in offline and operation saved in local database";
break;
case ERROR_WRONG_TIME:
str = @"operation canceled by server with wrong time(time from future)";
break;
case ERROR_TAG_OPERATION:
str = @"operation canceled by server as duplicated or incorrect";
break;
default:
break;
}
NSLog(@"%@ - %@ - %ld", str, tags, timestamp);
}
- (void)removeAll:(RPTagStatus)status timestamp:(NSInteger)timestamp {
NSString *str = @"";
switch (status) {
case SUCCESS:
str = @"success for add or delete";
break;
case OFFLINE:
str = @"app in offline and operation saved in local database";
break;
case ERROR_WRONG_TIME:
str = @"operation canceled by server with wrong time(time from future)";
break;
case ERROR_TAG_OPERATION:
str = @"operation canceled by server as duplicated or incorrect";
break;
default:
break;
}
NSLog(@"%@ - %ld", str, timestamp);
}
@end