请求通过短信访问位置的权限?
我正在尝试弄清楚如何请求另一台 Android 设备获得访问其位置的权限。也许通过短信上的某个链接来启动谷歌纵横?
关键是它应该是即时的,就像通知或短信一样。
您能想到的最接近的策略是什么?
更新:
谢谢大家的回答。在考虑了所有这些之后,我仍然对采取什么策略感到有点困惑。
也许最好告诉你我正在尝试实现的内容:
有人会来接你。您向他发送请求,他接受,应用程序会向您显示他距离您有多远以及他需要多长时间才能找到您。
我不希望接收者被迫安装该应用程序,因为这会降低其使用率。我想这个必要条件可以被驳回。
抱歉造成混乱。
I'm trying to figure out how to request another Android device for permission to access its location. Maybe through some link on a SMS to launch Google latitude?
The point is it should be instantaneous, like a Notification or an SMS.
What would be the closest strategy you can think of?
UPDATE:
Thanks guys for all your answers. After considering them all I am still a bit confused about what strategy to adopt.
Probably is better to tell you what I'm trying to implement:
Someone is going to pick you up. You send him a request, he accepts and the app shows you how far away he is and how long it will take him to get to you.
I didn't want the receiver to be forced to have the app cause it would lower its use. I guess that requisite could be dismissed.
Sorry for the confussion.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您不希望接收用户必须安装应用程序,您可以发送一条短信,其中包含指向您控制的网站的链接,该网站使用网络地理定位 API 来报告位置:http://dev.w3.org/geo/api/spec-source.html
用户需要单击该链接短信中,然后会提示他们允许该页面访问他们的位置。这不仅适用于 Android 设备,还适用于任何具有支持这些 API 的浏览器的设备
If you don't want the receiving user to have to install an app, you could send an SMS with a link to a website you control that uses web geolocation APIs to report position: http://dev.w3.org/geo/api/spec-source.html
The user will need to click the link in the SMS, then they will be prompted to allow the page to access their location. This will work not only on Android devices, but on any device with a browser that supports these APIs
这取决于您的应用程序的负载有多大。
如果我是你,我会编写一个系统,其中应用程序将保持与中央服务器的连接。这样,您的应用程序就可以在发生任何情况时收到通知。它还可以无缝集成,允许您的应用程序(确保您最初明确地请求许可)在请求时发送位置数据,而无需任何交互。
对于如此简单的操作来说,这显然更耗电量,但这是获得即时通知的最佳方式。
另一种方法是使用自定义 URL 方案向收件人发送电子邮件。
例如:
您可以在您的应用程序中通过设置来解析此类URL:
在你的意图过滤器中。
但这需要更多的用户交互方式。
It depends on how heavy duty your apps are.
If I were you I would write a system where the Apps would maintain a connection to a central server. That way your Apps can be notified the moment that anything happens. It could also be seamlessly integrated allowing your App (make sure you ask permission to allow it initially obviously) to send location data when requested without any interaction.
This is obviously more battery intensive for such a simple operation, but that is the best way to get instantaneous notifications.
Another way you could do it is to simply send an email to the recipient with a custom URL scheme.
Such as:
You could parse that kind of URL in your App by setting:
In your intent-filter.
This requires more in the way of user interaction though.