从mobile-config.js的JSON文件加载设置

时间:2015-03-12 20:32:12

标签: jquery json facebook cordova meteor

我想将我的FB应用程序的设置保存在流星代码中的一个位置。现在我已经为cordova集成添加了mobile-config.js文件,以及本机FB插件,我需要将我的FB应用程序设置放在两个地方。一个在Meteor设置JSON中,另一个在mobile-config.js文件中。我试图让mobile-config.js文件只是从其他JSON读取设置但是遇到了麻烦。有什么想法吗?

var $ = Npm.require('jquery');
$.getJSON('./private/config/settings.json', function(settings) {
  App.configurePlugin('com.phonegap.plugins.facebookconnect', {
    APP_ID: settings.public.fb.app_id,
    API_KEY: settings.private.fb.app_key,
  });
});


Error reading mobile-config.js:ReferenceError: Npm is not defined

0 个答案:

没有答案
相关问题