【问题标题】:Location update background mode app getting rejected位置更新后台模式应用程序被拒绝
【发布时间】:2014-05-12 05:22:46
【问题描述】:

我已经使用位置更新作为后台模式完成了一个应用程序,并且我在每个 keepAlive 间隔后使用 web 服务更新我的位置。我正在使用下面提到的代码。

if ([application respondsToSelector:@selector(setKeepAliveTimeout:handler:)])
    {
        [application setKeepAliveTimeout:120 handler:^{

            DDLogVerbose(@"KeepAliveHandler");

            // Do other keep alive stuff here.
        }];
    }
    self.bgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
        NSLog(@"ending background task");
        [[UIApplication sharedApplication] endBackgroundTask:self.bgTask];
        self.bgTask = UIBackgroundTaskInvalid;
    }];


    self.backgroundTimerForLocationUpdate = [NSTimer scheduledTimerWithTimeInterval:120
                                                                             target:self
                                                                           selector:@selector(changeAccuracy)
                                                                           userInfo:nil
                                                                            repeats:YES];

在位置委托中,我正在调用一个网络请求来更新服务器中的位置,以跟踪用户。

苹果会拒绝应用使用位置更新后台模式吗?

【问题讨论】:

  • 应该没问题...位置后台服务是可以接受的。

标签: ios objective-c cllocationmanager background-process appstore-approval


【解决方案1】:

如果您在应用程序处于后台时启动或停止位置更新,Apple 将拒绝该应用程序。

但是您可以使用“startMonitoringSignificantLocationChanges”方法在后台获取最新的位置更新。当应用程序处于后台时,它将更新当前位置值,当您进入前台模式时,您将拥有最新的位置信息来执行任何子序列活动。

【讨论】:

  • 是的,这是推荐的方式。但是,重大位置变化监控的工作方式在 iOS7 中发生了变化:stackoverflow.com/questions/18639976/…,因此除非您的应用没有被用户或操作系统杀死,否则您将无法跟踪用户的位置:(
【解决方案2】:
Will apple reject the app for using the location update background mode.

According to the Apple Documentation 你只有在你的iOS App 时才被允许

Playing and Recording Background Audio 连续播放或录制音频的应用程序(即使应用程序在后台运行时)可以注册以在后台执行这些任务。Tracking the User’s LocationImplementing a VoIP Client (Voice over Internet Protocol)。因此,因此完全没有问题,但最终结果将由Apple Review Team 声明

祝你好运

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-09
    • 1970-01-01
    • 1970-01-01
    • 2014-07-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多