1
我的應用的某些用戶(在特定的運營商,使用4g)無法加載照片。當網絡在LTE上時,可達性測試失敗
而且可達性測試也失敗了。但我可以訪問我的一些後端API,沒有任何問題。
但是,當我使用WiFi測試我的應用程序時,這絕不會發生。
什麼可能導致此問題?
代碼可達性測試:
- (IBAction)fbButtonPressed:(id)sender {
internetReachableFoo = [Reachability reachabilityWithHostname:@"http://www.google.com"];
// Internet is reachable
__weak id weakSelf = self;
internetReachableFoo.reachableBlock = ^(Reachability*reach)
{
// Update the UI on the main thread
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf showLoadingIndicators];
[[User sharedInstance] attemptToLoginToFB];
[[Mixpanel sharedInstance] track:@"Try to login using FB"];
});
};
// Internet is not reachable
internetReachableFoo.unreachableBlock = ^(Reachability*reach)
{
// Update the UI on the main thread
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Network Unavailable"
message:@"Try again when you are connected."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alertView show];
});
};
[internetReachableFoo startNotifier];
}
嗨。感謝您的回覆。任何想法爲什麼我的API的一部分工作?如果我在相同的網絡條件下打開Safari,我可以瀏覽沒有問題。 – noooooooob
不幸的是,可能有很多原因,例如照片可能超過某些尺寸標準,這些標準在某個網絡中被錯誤地設置;你的應用程序可能類似於運營商阻止的一些對等應用程序,並且它們無意中捕獲了一些流量等。如果它真的只是在這個特定的4G網絡上,我會收集一些具體示例並聯系他們的技術幫助。讓我們知道結果是什麼,以防萬一它是一個更一般的或特定於應用程序的問題。 – Mick