Skip to content
This repository

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

Open
nukulb opened this Issue · 6 comments

4 participants

Nukul Bhasin Ken Wallis Bryan Higgins gcsantiago
Nukul Bhasin

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

Ken Wallis
Owner

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

Nukul Bhasin
Ken Wallis
Owner
Bryan Higgins bryanhiggins referenced this issue from a commit in blackberry-webworks/BB10-WebWorks-Framework
Bryan Higgins 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
Bryan Higgins
Collaborator

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.

Ken Wallis
Owner
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.