Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序 后台定位能力 #4448

Closed
cinside opened this issue Sep 12, 2019 · 3 comments
Closed

小程序 后台定位能力 #4448

cinside opened this issue Sep 12, 2019 · 3 comments

Comments

@cinside
Copy link

cinside commented Sep 12, 2019

微信小程序目前可以使用后台持续定位能力, 但是这几天还没有发现有对这个原生api的封装, 我只有尝试写一个原生的组件, 然后在组件内部调用原生的api, 但是原生组件内部不能使用外部taro的一些值, 例如我把App当做原生组件的一个属性传进去, 在内部是无法使用 taro 中App初始化的玩儿socket task和App上的属性messages.
请问目前有什么好的方式可以调用到微信小程序的原生api或者在原生组件内部怎么完整的使用外部传进来的属性(尝试过Taro + wxapi的方式调用无效)
相关api: wx.startLocationUpdateBackground(Object object)
wx.onLocationChange(function callback) 等

@taro-bot
Copy link

taro-bot bot commented Sep 12, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@iugo
Copy link
Contributor

iugo commented Sep 12, 2019

不用写组件, 写个函数包裹 wx.* 就行了. 然后还在 taro 中用.

@cinside
Copy link
Author

cinside commented Sep 17, 2019

不用写组件, 写个函数包裹 wx.* 就行了. 然后还在 taro 中用.

非常感谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants