我有一个页面,我需要根据设备的当前位置获取用户的当前位置,我使用了"buildfire.geo.getCurrentPosition",它正在本地主机开发中工作,但在发布期间它不起作用。
buildfire.geo.getCurrentPosition(null, (err, position) => {
if(err)
console.log(err);
else {
let currentLoc = this.state.currentLoc;
currentLoc['coordinates'] = {lat: position.coords.latitude, lng: position.coords.longitude};
this.setState({currentLoc});
}
});发布于 2017-12-14 01:35:18
确保正在检查位置的插件具有在plugin.json文件中指定的适当功能。
下面是一个包含该特性的示例plugin.json。
{
"author":"Jane Doe"
,"pluginName":"Sample Plugin "
,"pluginDescription":"This is an example"
,"supportEmail":"support@buildfire.com"
,"control":{
"content":{
"enabled":true
}
, "design":{
"enabled":true
}
, "settings":{
"enabled":false
}
},
"features" : [{"name" : "GEO"}],
"languages" : ["en"],
}请注意,向plugin.json添加新功能需要对应用程序进行硬性构建,因此您不会立即看到更改。
发布于 2017-12-14 08:42:09
我已经将该功能添加到plugin.json文件中。
{
"author": "Sio Donayre"
,"pluginName": "Coupon Plugin"
,"pluginDescription": "Simple Discount Coupon Plugin"
,"supportEmail": "sio.donayre@go-va.com.au"
,"control": {
"content": {
"enabled": true
}
, "design": {
"enabled": false
}
, "settings": {
"enabled": false
}
}
,"widget": {},
"features" : [
{
"name": "GEO"
},
{
"name" : "Calendar"
}
],
"languages" : ["en"]
}https://stackoverflow.com/questions/47789387
复制相似问题