简体   繁体   English

iOS定位服务-是否可以通过编程方式设置位置感知应用程序的授权状态?

[英]iOS Location Services - Is there any way to set the authorization status of a location-aware application programmatically?

Just wanted to know, if there is any way in iPhone 3GS (with iOS 4.0) to turn ON/OFF the authorization status of the location-aware application programmatically. 只是想知道,iPhone 3GS(带有iOS 4.0)中是否可以通过编程方式打开/关闭位置感知应用程序的授权状态。

+ (CLAuthorizationStatus)authorizationStatus __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_2);

As we all know, the above class method returns the current authorization status of the calling application in iOS 4.2 and above. 众所周知,上述类方法返回iOS 4.2及更高版本中调用应用程序的当前授权状态。 I am unable to find any API to be able to set the authorization status of a location-aware app programmatically. 我找不到任何API能够以编程方式设置位置感知应用程序的授权状态。 Please help. 请帮忙。

As has been pointed out to you in the comments, it would be a little crazy - insane, even - if applications could programmatically override user authorization on location. 正如评论中向您指出的那样,即使应用程序可以通过编程方式覆盖位置上的用户授权,这也会有些疯狂-疯狂。 What would be the point of asking a user for their permission to use their current location if the app could just get it without asking? 如果应用程序无需询问就可以获取当前位置,那么问用户的许可有什么意义呢?

Apple have made an increasingly bigger deal about permissions and authorization of location information, so this simple isn't possible on the public SDK. 苹果在位置信息的权限和授权方面做得越来越大,因此在公共SDK上不可能做到这一点。 Perhaps you could achieve it on jailbroken handsets using private APIs. 也许您可以使用专用API在越狱的手机上实现它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM