Skip to content

Unconditional Delivery Listeners

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

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

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