Skip to content

Unconditional Delivery Listeners

The where clause argument in the addCreateListener method is optional. When it is not provided, the real-time database will deliver any new object created in the database's table:

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

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