首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Buildfire: buildfire.geo.getCurrentPosition不支持移动应用程序(安卓和ios)和PWA

Buildfire: buildfire.geo.getCurrentPosition不支持移动应用程序(安卓和ios)和PWA
EN

Stack Overflow用户
提问于 2017-12-13 17:17:47
回答 2查看 70关注 0票数 0

我有一个页面,我需要根据设备的当前位置获取用户的当前位置,我使用了"buildfire.geo.getCurrentPosition",它正在本地主机开发中工作,但在发布期间它不起作用。

代码语言:javascript
复制
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});
  }
});

Working on localhost

But not on the app control panel upon updating the plugin

EN

回答 2

Stack Overflow用户

发布于 2017-12-14 01:35:18

确保正在检查位置的插件具有在plugin.json文件中指定的适当功能。

下面是一个包含该特性的示例plugin.json。

代码语言:javascript
复制
{
  "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添加新功能需要对应用程序进行硬性构建,因此您不会立即看到更改。

票数 0
EN

Stack Overflow用户

发布于 2017-12-14 08:42:09

我已经将该功能添加到plugin.json文件中。

代码语言:javascript
复制
    {
  "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"]
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47789387

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档