I’m having same problem. Allow me to copy-paste my description from slack chat, (seems it got no attention) :
I wasn’t been able to call it successfully.
When I tried with async (copy-pasted from doc in 3.0)
var eventArg = {};
var successHandler = function( obj ) {console.log(‘ok’, obj);};
var errorHandler = function( obj ) {console.log(‘err’, obj);};
Backendless.Events.dispatch( “myCustomEvent”, eventArgs, new Backendless.Async( successHandler, errorHandler ) );
it gave me error Uncaught TypeError: Backendless.Async is not a function
and when I tried with promise it didn’t worked either
Backendless.Events.dispatch( “myCustomEvent”, {})
.then(function( obj ) {console.log(‘ok’, obj);})
.catch(function( obj ) {console.log(‘err’, obj);})
gave me error Right-hand side of ‘instanceof’ is not callable
I have a strong suspicion that you have a bug in SDK regarding dispatching custom event, (checking for async argument)
I managed to successfully call using workaround
Backendless.Events.dispatch( “myCustomEvent”, eventArgs, Date ).then(function( obj ) {console.log(‘ok’, obj);}).catch(function( obj ) {console.log(‘err’, obj);})
see “Date” as last argument
this issue will be fixed in ~1-2h, and we will release a new version of JS SDK with that fix.
I will notify you here and in Slack when it’s ready. Thanks for your patience.