 
             _initialized = true;
 
+            NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);
+            NativeApplication.nativeApplication.addEventListener(Event.ACTIVATE, onActivate);
+            NativeApplication.nativeApplication.addEventListener(Event.DEACTIVATE, onDeactivate);
+
             dataArr = event.code.split("_");
             if (dataArr.length == 2) {
                 callbackName = dataArr[1];

    {
        if (isSupported && _context != null) {

            _context.call("setNativeLogEnabled", Facebook.nativeLogEnabled);
            log("ANE Facebook version: " + VERSION);
            // iOS is synchronous but we will simulate async to have consistent API
            _context.call("initFacebook", appID, getNewCallbackName(onInitialized));
        } else {

            log("Can't initialize extension! Unsupported platform or context couldn't be created!")

                log("ERROR - Extension context is null. Please check if extension.xml is setup correctly.");
                return;
            }

            _instance = this;
        }
