 
 
 class Events
+
+  @eventCounter = Date.now()
 
   @dispatchVisibilitychangedEvent: (options={}) =>
     steroids.debug

      @dispatchVisibilitychangedEvent()


    steroids.nativeBridge.nativeCall
      method: "addEventListener"
      parameters:
        event: "focus"
      successCallbacks: [focusAdded,callbacks.onSuccess]
      recurringCallbacks: [becomeVisibleEvent, callbacks.onFailure]
      steroids.debug
        msg: "focus added"

      event = "lostFocus"
      eventHandlerId = ++Events.eventCounter;

      steroids.nativeBridge.nativeCall
        method: "addEventListener"
        parameters:
          event: event
          eventHandlerId: "#{event}_#{eventHandlerId}"
        successCallbacks: [lostFocusAdded,callbacks.onSuccess]
        recurringCallbacks: [becomeHiddenEvent, callbacks.onFailure]

