且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

以编程方式打开/关闭GPS,而无需在iPhone中提示用户

更新时间:2023-02-20 20:30:16

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

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.