Skip to content

As a webworks developer, I have access to an exit event for when my application exits #393

Open
nukulb opened this Issue Nov 27, 2012 · 6 comments

4 participants

@nukulb
nukulb commented Nov 27, 2012

Two APIs need to be exposed for this to be truly useful feature
APIs exposed

  • blackberry.app.extendTerminate()
  • event - called exit under blackberry.event.addEventListener("exit", function () { ...} );

The application will get 3 seconds to terminate, if the application requires more time to exit then it must call extendTerminate(). Each time extendTerminate is called the application will get 2 more seconds to exit.
If the app does not terminate in allotted time it will be exited by the navigator.

Implementation -
Listen to exit event from the webplatform, under application.
Call

@kwallis
Open Source Projects member
kwallis commented Nov 28, 2012

Can the app extend indefinitely? Seems like we shouldn't allow it to effectively never close.

@nukulb
@kwallis
Open Source Projects member
@bryanhiggins bryanhiggins added a commit to blackberry-webworks/BB10-WebWorks-Framework that referenced this issue Nov 29, 2012
@bryanhiggins bryanhiggins Implementation of blackberry.app.extendTerminate and exit event
This is not working! executeJavaScript does not work to send the event to the client webview. It appears WebKit completely kills the webview as soon as the exit event occurs. Extend terminate is working from within the controller.

Issue #393
fb591e7
@bryanhiggins

I looked into this, but got blocked by WebKit killing the client webview as soon as the exit event is fired. The controller fires executeJavaScript, but this is never invoked on the other side. Extend terminate does work as advertised, but it is of no use if the client webview doesn't live past the initial exit event.

blackberry-webworks@fb591e7

@gcsantiago

can we use it to cancell the exit process ?... i mean, the user try to exit (but wrong or repent) then fire the callback and inside the callback a toast with the onclick button to cancel. I think use "toast" because the countdown time.

@kwallis
Open Source Projects member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.