我有一个插件, https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin,我想与Meteor一起使用.我将GIT repo添加到了app / .meteor / cordova-plugins. 该插件需要在安装时传递给它的变量.我该如何添加该变
该插件需要在安装时传递给它的变量.我该如何添加该变量?
我把它添加到mobile-config.js:
// Pass preferences for a particular PhoneGap/Cordova plugin App.configurePlugin('nl.x-services.plugins.launchmyapp', { URL_SCHEME: 'mycoolapp' }); App.setPreference("URL_SCHEME", "mycoolapp");
我仍然收到错误,指出缺少变量URL_SCHEME.
如果有人偶然发现,我会发一个完整的答案.从Meteor Phonegap documentation开始:
Some Cordova/Phonegap plugins, such as the “Facebook Connect” plugin, require build-time variables such as an APP_ID or APP_NAME. To include these variables in your Cordova/Phonegap build, set them up in your Mobile Configuration file (starting from 0.9.4). (07001)
因此,如果您查看示例,可以在应用程序的mobile-config.js文件中执行此操作:
App.configurePlugin(‘org.apache.my-plugin’,{ 变量:’价值’});