IBM Worklight - 如何在更新应用程序之前执行JavaScript代码?

问题描述:

当有新的软件更新可用时,如果用户将数据存储在jsonstore中,我需要允许用户在应用软件更新之前将它们提交到服务器,因此他/她的未经更新的更新不会丢失。
目前用户在安装更新之前无法使用该应用程序。

When a new software update is available, if user has data stored in jsonstore I need to allow user to commit them to the server before applying the software update, so his/her uncommited updates don't get lost. Currently user is unable to use the application until the update is installed.

有没有办法在更新应用程序之前执行JavaScript代码,这样我就可以初始化jsonstore,在执行更新安装之前获取数据并发送到适配器?

Is there a way to execute JavaScript code before updating the application so I can initialize the jsonstore, take the data and send to the adapter before performing the update installation?

我们看到卸载和 beforeunload事件在DirectUpdate之前被触发。如果数据在那个时间点仍然可以在内存中使用,这可能是代码选项吗?

We saw that the "unload" and "beforeunload" events are fired before a DirectUpdate. Maybe this is an option for code if the data is still available in memory at that point in time?

WL 5.0.6.1 Android - 直接更新使Native / Cordova资源保持活动状态内存(例如BusyIndi​​cator)但参考丢失了