以编程方式打开/关闭GPS,而无需在iPhone中提示用户 [英] Turn on/off GPS programmatically without prompting the user in iphone

查看:46
本文介绍了以编程方式打开/关闭GPS,而无需在iPhone中提示用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正计划在某人的iphone丢失或被盗时编写应用程序代码.因此,它需要通过GPS告知手机的位置,但是如果手机被盗,请小偷打开GPS并不是一个好主意.因此,我想知道是否有可能在不提示用户的情况下打开/关闭GPS.谢谢.

I'm planning to code an application for the times when someone's iphone is lost or stolen. So it needs to tell the location of the phone via GPS, but in case it's stolen, it wouldn't be a good idea to ask the thief to turn on the GPS. So I'd like to know if there is a possibility of turning on/off the GPS without prompting the user. Thanks.

推荐答案

您不能完全绕过提示.但是,如果用户允许应用使用位置数据,它将不会永远显示.一旦用户两次允许该访问,该应用将不再提示.对于您所描述的应用程序,用户必须首先执行此操作,然后才可以在没有提示的情况下继续进行访问.

You can't bypass the prompt completely. But it won't show up forever, if the user allows the app to use location data. Once the user allows this access twice, the app won't prompt any more. For an app like the one you describe, the user would have to do this first, and only then could future access proceed without a prompt.

启用定位服务后,屏幕顶部仍然有指针图标.但是,没有办法解决这个问题.

There's still the pointer icon at the top of the screen when location services is active. There's no way around that, though.

这篇关于以编程方式打开/关闭GPS,而无需在iPhone中提示用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆