从 Store 或 TestFlight 安装应用程序时,可达性表示不覆盖

Posted

技术标签:

【中文标题】从 Store 或 TestFlight 安装应用程序时,可达性表示不覆盖【英文标题】:Reachability says no coverage when app is installed from Store or TestFlight 【发布时间】:2013-01-25 16:03:07 【问题描述】:

我在 ios 上的可达性方面遇到了这个非常奇怪的问题。如果我在设备上以调试方式运行我的应用程序,则完全没有问题,该应用程序运行良好。但是,当我从商店或从 TestFlight 安装它时,即使我在 Wi-Fi 上,我也会收到无覆盖错误,但只有当我尝试执行某些操作时。如果我不执行该特定操作,则应用程序运行良好,直到我执行为止。

这是我处理可达性的代码部分:

- (void)connectionReachabilityChanged:(NSNotification *)notice 
  NetworkStatus status = [self.connectionReachability currentReachabilityStatus];
  if (status == NotReachable) 
    self.inCoverage = NO;
   else 
    self.inCoverage = YES;
  


- (void)hostReachabilityChanged:(NSNotification *)notice 
  NetworkStatus status = [self.hostReachability currentReachabilityStatus];
  if (status == NotReachable) 
    self.inCoverage = NO;
   else 
    self.inCoverage = YES;
  


- (void)displayAlertOfType:(AlertType)type 
  if (type == AlertTypeNoCoverage) 
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"No coverage"
                                                    message: @"You current have no data coverage, try again later"
                                                   delegate: self
                                          cancelButtonTitle: @"OK"
                                          otherButtonTitles: nil];
    [alert show];
  

  if (type == AlertTypeOperationNotCompleted) 
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Whoops... Something went wrong" 
                                                    message:@"The operation couldn't be completed, try again later" 
                                                   delegate:self 
                                          cancelButtonTitle:@"OK" 
                                          otherButtonTitles:nil];
    [alert show];
  


【问题讨论】:

那是什么“具体行动”。 取消关联或关联社交网络帐户。它与任何其他网络调用没有什么不同,但由于某种原因它变得疯狂。 WiFi 信号有多强。 全力,这是我的家庭网络。问题是,如果我通过使用 Xcode 编译它来安装应用程序,它可以正常工作,但是从 TestFlight 或 App Store 中它会失败,即使存档是完全相同的版本。 您应该联系 Apple。 【参考方案1】:
 Reachability *reachability = [Reachability sharedReachability];
 [reachability setHostName:@"http://www.google.com/"]; 
 NetworkStatus remoteHostStatus = [reachability remoteHostStatus];

if(remoteHostStatus == NotReachable) 
 //no internet connection

    UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"No coverage"
                                                    message: @"You current have no data coverage, try again later"
                                                   delegate: self
                                          cancelButtonTitle: @"OK"
                                          otherButtonTitles: nil];
    [alert show];
 
 else if (remoteHostStatus == ReachableViaWiFiNetwork) 
 //wifi connection found
 
 else if (remoteHostStatus == ReachableViaCarrierDataNetwork) 
 //EDGE or 3G connection found
 

【讨论】:

如果我想检查 Internet 连接,我会使用此代码。它应该可以工作。 看起来和我自己的很相似。不要认为问题实际上是代码。

以上是关于从 Store 或 TestFlight 安装应用程序时,可达性表示不覆盖的主要内容,如果未能解决你的问题,请参考以下文章

TestFlight 和 App Store 区域

Xcode:推送通知以在设备工作上构建,而不是在同一设备上安装 TestFlight/App Store

当应用程序已在 Apple Store 上发布时通过 TestFlight 分发

提交实际版本号低于其 TestFlight 版本的同一应用程序的 App Store 版本

我应该在 App Store 中的 TestFlight 连接后更改我的应用程序的构建版本吗? [关闭]

是否可以从 Xcode 7 beta 将 iOS 应用上传到 App Store 进行内部测试?