Iphone 可达性表示,从应用商店或TestFlight安装应用程序时没有覆盖范围
我在iOS上遇到了一个非常奇怪的可达性问题。如果我在设备上以调试方式运行我的应用程序,则完全没有问题,应用程序运行正常。但当我从商店或TestFlight安装它时,即使我使用Wi-Fi,也会出现无覆盖错误,但只有当我尝试执行某些操作时才会出现。如果我不做那个特定的动作,应用程序在我做之前运行良好 这是我的代码中处理可达性的部分:Iphone 可达性表示,从应用商店或TestFlight安装应用程序时没有覆盖范围,iphone,ios,objective-c,ipad,reachability,Iphone,Ios,Objective C,Ipad,Reachability,我在iOS上遇到了一个非常奇怪的可达性问题。如果我在设备上以调试方式运行我的应用程序,则完全没有问题,应用程序运行正常。但当我从商店或TestFlight安装它时,即使我使用Wi-Fi,也会出现无覆盖错误,但只有当我尝试执行某些操作时才会出现。如果我不做那个特定的动作,应用程序在我做之前运行良好 这是我的代码中处理可达性的部分: - (void)connectionReachabilityChanged:(NSNotification *)notice { NetworkStatus sta
- (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或应用程序商店它失败,即使存档是完全相同的版本。你应该联系苹果。如果我想检查互联网连接,我使用此代码。它应该能用。看起来和我的差不多。不要认为问题在于代码本身。
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
}