Added Obj-C code for event callbacks, renamed callback function accordingly in JS.