2013-04-23 68 views
0

从2.4版升级到phonegap 2.6后,navigator.notification.prompt方法停止工作。 Xcode中吐出了这个错误:Phonegap 2.6 - iOS升级后通知提示不起作用

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; 
    } 
} 

但是,confrim方法也不起作用,但是警报却起作用。

我注意到,当我在浏览器中查看该网站时,我也收到了一条新的错误消息,它说cordova_plugins.json 404(Not Found)。我不确定这是为了什么,或者它与我的问题有关。

回答

0

事实证明,通知工作正常。这个问题与我通往CordovaLib.xcodeproj的路径没有得到更新,当我更新项目时,它指向的是旧版本