最后,我能够自己弄清楚所有。
步骤1:添加插件到应用程序
通过移动到项目文件夹通过命令行,运行命令的下面的行向插件添加到项目
sudo cordova plugin add https://github.com/petermetz/cordova-plugin-ibeacon.git
第2步:在应用程序中使用该插件
确保在plugins/fetch.json
插件的细节补充:
"com.unarin.cordova.beacon": {
"source": {
"type": "git",
"url": "https://github.com/petermetz/cordova-plugin-ibeacon.git",
"subdir": "."
},
"is_top_level": true,
"variables": {}
}
而在plugins/android.json
在installed_plugins
以下行都是存在的,
"com.unarin.cordova.beacon": {
"PACKAGE_NAME": "io.ionic.starter"
}
这它,我们开始使用应用程序中任何页面的插件功能,通过使用变量:cordova.plugins.locationManager
使用范例:
要启用蓝牙设备:cordova.plugins.locationManager.enableBluetooth();
注意 如果没有工作的罚款,再次更新插件。首先更新cordova-plugin-ibeacon
removed
该应用程序的插件和added again
。
请不要共享如果您有任何文章或与该主题相关的文档。 – Dipak