如何添加一个变量到Meteor的phonegap插件? [英] How do I add a variable to a phonegap plugin with Meteor?

查看:134
本文介绍了如何添加一个变量到Meteor的phonegap插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个插件, https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin ,我想用Meteor。我将GIT库添加到 app / .meteor / cordova-plugins

I have a plugin, https://github.com/EddyVerbruggen/LaunchMyApp-PhoneGap-Plugin, that I would like to use with Meteor. I added the GIT repo to app/.meteor/cordova-plugins.

插件需要一个变量在安装时传递给它。如何添加该变量?

The plugin requires a variable to be passed to it when it's installed. How would I add that variable?

我将此添加到 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。

I am still getting the error that states that the variable URL_SCHEME is missing.

推荐答案

我会发布一个完整的答案,以防有人绊倒。

I will post a complete answer in case someone stumbles on it.

href =https://github.com/meteor/meteor/wiki/Meteor-Cordova-Phonegap-integration> Meteor Phonegap说明文件:

From Meteor Phonegap documentation:


某些Cordova / Phonegap插件(例如Facebook Connect插件)需要构建时变量,例如APP_ID或APP_NAME。要在Cordova / Phonegap构建中包括这些变量,请在移动配置文件(从0.9.4开始)中进行设置。 ( https://github.com/meteor/meteor/wiki/Meteor) -Cordova-Phonegap-integration#cordova-plugins-configuration

所以如果你看看这个例子,在应用程序的 mobile-config.js 文件中执行此操作的方法:

So if you look at the example, here is a way to do it in your app's mobile-config.js file:


App.configurePlugin('org.apache.my-plugin',{
variable:'value'
});

这篇关于如何添加一个变量到Meteor的phonegap插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆