reachability

Detecting Network Connectivity Changes using Reachability, NSNotification and Network Link Conditioner in Swift

蹲街弑〆低调 提交于 2019-12-27 11:38:54
问题 I'm trying to integrate network connectivity detection into my app, however it seems that somewhere along the line I have made a mistake as my network changes are not being detected/printed out into the console. As mentioned in the post, I'm currently using these following classes and tools for the job: Reachability {.h, .m} NSNotificationCenter Network Link Conditioner Code In the AppDelegate.Swift , I've set up the NSNotificationCenter to detect changes: func application(application:

wrong status for Reachability in appDidBecomeActive

眉间皱痕 提交于 2019-12-25 14:07:59
问题 I'm using Reachability class, which Apple provided and faced one strange thing. App checks connection every time app did become active, and if it's active, update some data. When i turn on airplane mode and just after that relaunch the app, so didBecomeActive will be called, reachability returns wrong status(reachableViaWiFi). And if you repeat this one more time, correct status is returned. Also i've noticed, that if you turn airplane mode, wait for a several seconds and then relaunch the

Compilation details and reachability algorithms

你离开我真会死。 提交于 2019-12-25 01:25:52
问题 Should I make an analysis of reachability of parts of a graph (called rule): a node can be reached if a certain boolean condition is verified. Each node knows only its predecessor, there are different types of nodes and not all nodes have at guard a condition to be verified. The rule is placed in a file. I made ​the parsing of the rule, I have selected (through the use of discriminated union) and ordered the nodes in accordance with the flow of execution. Now, I should make a kind of static

How to get Mobile data status in iPhone when WiFi is ON

不打扰是莪最后的温柔 提交于 2019-12-24 13:28:24
问题 Currently i am working on an iPhone Application which needs to display the mobile data status(ON/OFF). For network check im using Reachability class but it is giving me correct result when any one of the networks are enable i.e WiFi/Mobile Data, but if both are enable it is giving Wifi status, but my requirement is i just need to mobile data status also. It would be great if anyone suggest me solution. Thankq 回答1: Set some logic , like check , if network is connected to Wifi or Cellular-data

iOS Reachability Not Recognizing When Host is Removed

℡╲_俬逩灬. 提交于 2019-12-24 05:32:48
问题 I am building an application and trying to check and see if a device is still available on the network (by connecting to the devices IPAddress). I am using reachability to confirm that it is available. When I network access for the iOS device (turn on airplane mode for example) everything works properly, but if I remove the device from the network, reachability does not seem to notice the change. It seems like reachability is caching the results, and not seeing the update. 回答1: Don't use

Reachability with Address - Server AND Port - iOS 5

巧了我就是萌 提交于 2019-12-23 15:19:22
问题 I am trying to check whether a server is online or offline: I face the problem that it has a port when connecting to it My code at the moment: struct sockaddr_in address; address.sin_len = sizeof(address); address.sin_family = AF_INET; address.sin_port = htons(25667); address.sin_addr.s_addr = inet_addr("fr7.mooshroom.net"); Reachability *reachability = [Reachability reachabilityWithAddress:&address]; Please let me know what im doing wrong. And please dont link me to other questions, I have

How App in background can check for internet connection, IOS?

♀尐吖头ヾ 提交于 2019-12-23 09:36:56
问题 My Iphone app have 2 mode, online mode, and offline mode. if user is using app in online mode, the request gets submitted to server immediately. if user is using app in offline mode, i will store the request locally, so that i can upload it when internet is available. I am using reachability class to check internet availability. Reachability is working fine with app. I am not able to achieve following scenario. I had stored request as user is working in offline mode, mean while user will push

How does the iOS Reachability class work, and why the IP Address 169.254.0.0?

删除回忆录丶 提交于 2019-12-22 23:36:14
问题 How does the iOS Reachability class work, and what's so special about the IP Address 169.254.0.0? I'm trying to figure out whether Wi-Fi is on, independent of whether it is connected to an actual Wi-Fi network or not. I haven't found a satisfactory answer for this question on SO, and even the answers that try to answer this don't work for me. 回答1: When you fail to get an IP address from DHCP, it will automatically assign you a random address in the 169.254.x.x range. So if you have an IP

Detecting internet connectivity continually

徘徊边缘 提交于 2019-12-22 11:01:20
问题 I want my app to detect the internet connection loss automatically. So im using the following code. - (void)applicationDidBecomeActive:(UIApplication *)application { Reachability *networkReachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [networkReachability currentReachabilityStatus]; if (networkStatus == NotReachable) { [Settings hideSpinner]; //Show no internet connectivity dialog. } else { } } But the problem is that it is not checking the

Cannot invoke initializer for type 'UnsafeMutablePointer'

无人久伴 提交于 2019-12-22 10:09:08
问题 I'm trying to update Reachability.swift to swift 3.0 and I'm having trouble passing the Reachability instance to the call back function. Here is my snippet: * please note self = Reachability class var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) context.info = UnsafeMutablePointer(Unmanaged.passUnretained(self).toOpaque()) Where the compiler throws an error saying: Cannot invoke initializer for type 'UnsafeMutablePointer<_>'