plugin 可說是 phonegap 的靈魂了,下面介紹如何插入 plugin

1.打開cmd 將 目錄移至 您的專案的位置( 下圖就是將路徑 移至 test ),如下

 

index  

2. 我以加入 notification vibrate  為例,cmd 輸入以下

cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-vibration.git

執行後,就會把 plugin 自動加入,其他的請參考 Api 文件 

 

3. 加入後,在html 裡面不太需要執行什麼特別的東西,就可以使用,

     因為cordova.js 會幫你取出這些東西

   ,只需要在你的html 放入 script 標簽就可以了

 

 

相關文章