我一直关注this tutorial使用Meteor,Angular和Ionic创建一个WhatsApp风格的消息应用程序。
当我在模拟器上运行它时,它适用于settings.json:
meteor run ios --settings server / settings.json
但是当我尝试通过Xcode在手机上运行它时:
meteor run ios-device --settings server / settings.json
它需要来自settings.json
的内容时崩溃非常感谢任何帮助!谢谢。
答案 0 :(得分:0)
--mobile-settings Set optional data for the initial value of Meteor.settings
in your mobile application. A new value for
Meteor.settings can be set later by the server as part of
hot code push.
在部署到移动设备时使用--mobile-settings
发送移动设备的初始设置信息 - 如果您在应用程序连接后通过热代码推送在服务器上声明--settings
,则会被覆盖但是需要最初的移动设置告诉它在应用热代码推送之前要做什么。
我只使用过Android,但我想同样适用于iOS,因为您可能需要声明--mobile-server http://server:port
告诉它在部署后在网络上连接的位置。
您可能需要考虑将settings.json放入根文件夹而不是服务器文件夹,以确保整个代码库具有访问权限,您可以使用私有和公共对象控制值的可见性
{
"randomkey": "AB231489756"
"public": {
"val1": "AB4444"
},
"private": {
"val2": "AB5555"
}
}
在上面的randomkey和val2中,私有且只能在服务器上访问,而公共对象下的val1对客户端和服务器都是可见的