自从从 2.4 升级到 phonegap 2.6 以来,方法 navigator.notification.prompt 已经停止工作。Xcode 吐出这个错误:
ERROR: Method 'prompt:' not defined in Plugin 'Notification'
-[CDVCommandQueue executePending] [Line 103] FAILED pluginJSON = ["Notification1135621647","Notification","prompt",["Are you sure you want to permanently delete this code?","Delete Tracking Code FFHFDCVHHGG",["Delete","Cancel"]]]
这就是我设置提示调用的方式,它几乎直接来自 PhoneGap 文档。该事件是通过主干从单击事件触发的。
navigator.notification.prompt(
'Are you sure you want to permanently delete this code?', // message
onPrompt, // callback to invoke with index of button pressed
'Delete Tracking Code ' + self2.options.parentModel.toJSON().track_code.toUpperCase(), // title
['Delete','Cancel'] // buttonLabels
);
function onPrompt(button) {
if (button === 1) {
self2.options.parentModel.clear(); // Remove the item from local storage
nzp.router.navigate('tracking', {trigger: true}); // Navigate to the tracking page
} else {
return false;
}
}
conrim 方法也不起作用,但是 alert 方法起作用。
我注意到,当我在浏览器中查看该站点时,我也会收到一条新的错误消息,上面写着 cordova_plugins.json 404 (Not Found)。我不确定这是为了什么,或者它是否与我的问题有关。