Skip to content

Unconditional Delivery Listeners

The where clause argument in the addUpdateListener method is optional. When it is not provided, the real-time database will deliver any object  which is being updated in the database's table:

EventHandlerForClass *eventHandler = [Backendless.shared.data of:[Order class]].rt;
RTSubscription *subscription = [eventHandler addUpdateListenerWithResponseHandler:^(Order *updatedObject) {
    NSLog(@"Order has been updated: %@", updatedObject);
} errorHandler:^(Fault *fault) {
    NSLog(@"Error: %@", fault.message);
}];
let eventHandler = Backendless.shared.data.of(Order.self).rt
let subscription = eventHandler?.addUpdateListener(responseHandler: { updatedObject in
    print("Order has been updated: \(updatedObject)")
}, errorHandler: { fault in
    print("Error: \(fault.message ?? "")")
})

EventHandlerForMap *eventHandler = [Backendless.shared.data ofTable:@"Order"].rt;
RTSubscription *subscription = [eventHandler addUpdateListenerWithResponseHandler:^(NSDictionary *updatedObject) {
    NSLog(@"Order has been updated: %@", updatedObject);
} errorHandler:^(Fault *fault) {
    NSLog(@"Error: %@", fault.message);
}];
let eventHandler = Backendless.shared.data.ofTable("Order").rt
let subscription = eventHandler?.addUpdateListener(responseHandler: { updatedObject in
    print("Order has been updated: \(updatedObject)")
}, errorHandler: { fault in
    print("Error: \(fault.message ?? "")")
})