调出“应用程序想使用您当前的位置”再次对话 [英] Bring up the "App Would Like to Use Your Current Location" dialogue again

查看:129
本文介绍了调出“应用程序想使用您当前的位置”再次对话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

允许使用当前位置>是否可以拨打警报允许使用当前位置

在我的应用程序中,所有功能均基于用户当前位置。观众是除怪异之外的所有事物。

in my app, all of the functionality is based on the users current location. The audience is everything else than geeky.

我认为用户首先启动了该应用程序-因为用户不确定自己可以做什么,所以s /他可能对应用程序的是否要使用您的当前位置?感到困惑。如果他回答不允许,他将不会在屏幕上获得任何数据。

I think about the user starts the app for the first - as a user is not really sure about what it can do, s/he might be confused about the app's "Would Like to Use Your Current Location?" If he answers with "Don't allow", he won't get any data on the screen.

现在我处理:

- (void)locationManager:(CLLocationManager *)manager
   didFailWithError:(NSError *)error {

    if (error.code ==  kCLErrorDenied) {
        NSLog(@"Location manager denied access - kCLErrorDenied");

        UIAlertView *alert = 
              [[UIAlertView alloc] initWithTitle:@"Location issue" 
                                         message:@"Your location cannot be determined." 
                                        delegate:self 
                               cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
        [alert release];
    } 
}   

好的,该应用程序有一个Reload-Button。假设用户点击该重新加载按钮,系统将不会再询问他启用基于位置的服务。

Okay, the app has a Reload-Button. Assuming the user taps that reload button, he will not get asked again by the system to enable location based services.

如何强制iOS再次请求当前位置?

How could I force iOS to ask for current location again?

推荐答案

当前,唯一快速的方法似乎是要求用户重新启动应用程序然后崩溃(或设置UIApplicationExitsOnSuspend键并启动Safari)。当用户重新启动该应用程序时,该对话框将可用。

Currently, the only fast way to do this is appears to be to ask the user to restart the app and then crash (or set the UIApplicationExitsOnSuspend key and launch Safari). When the user relaunches the app, the dialog will be available.

这可能会或可能不会导致您的应用程序在Apple审核后立即被拒绝。

This may or may not get your app promptly rejected when Apple reviews it.

这篇关于调出“应用程序想使用您当前的位置”再次对话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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