0
在版本更新期间,用户将在活动应用程序后收到更新通知,将弹出更新警报框,并且他/她能够选择“更新”或“取消”更新请求。IBM MobileFirst Detect应用程序版本更新
如何检测用户选择的动作(更新/取消)?
在版本更新期间,用户将在活动应用程序后收到更新通知,将弹出更新警报框,并且他/她能够选择“更新”或“取消”更新请求。IBM MobileFirst Detect应用程序版本更新
如何检测用户选择的动作(更新/取消)?
如果使用产品中默认提供的功能,则不能。
为了做这样的“检测”,你需要实现自定义直接更新,但它听起来不像你的情况下需要完全定制,所以你可以看看下面的例子在“自定义用户界面“:https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/advanced-client-side-development/using-direct-update-to-quickly-update-your-application/#userExprience
在示例代码中,有其他代码可以启动或取消更新过程,因此您可以添加其他代码以”知道“它已启动或取消。
wl_directUpdateChallengeHandler.handleDirectUpdate = function(directUpdateData,
directUpdateContext) {
// custom WL.SimpleDialog for Direct Update
var customDialogTitle = 'Custom Title Text';
var customDialogMessage = 'Custom Message Text';
var customButtonText1 = 'Update Application';
var customButtonText2 = 'Not Now';
WL.SimpleDialog.show(customDialogTitle, customDialogMessage,
[{
text : customButtonText1,
handler : function() {
directUpdateContext.start();
// Additional code here.
}
},
{
text : customButtonText2,
handler : function() {
wl_directUpdateChallengeHandler.submitFailure();
// Additional code here.
}
}]
);
};