0
我正在使用cordova 2.1.0,並且正在嘗試向狀態欄添加通知。未捕獲TypeError:無法讀取屬性'statusBarNotification'的未定義
我會包括相關的Java文件和JS腳本到項目,並在
<plugin name="StatusBarNotification" value="com.phonegap.plugins.statusBarNotification.StatusBarNotification"/>
在我的HTML代碼,我添加了以下線路中的config.xml中添加以下行我head標籤
<script src="cordova-2.1.0.js"/>
<script src="statusbarnotification.js"/>
,並在內容DIV頁面的底部,我添加了下面的腳本
<script>
window.plugins.statusBarNotification.notify("Message Header", "Message details");
</script>
但是,當我在模擬器中運行它爲Android 4.0,我打的錯誤:
Uncaught TypeError: Cannot read property 'statusBarNotification' of undefined
任何人有之前遇到這個問題?