Re: An API for Airplane mode on iOS?
Re: An API for Airplane mode on iOS?
- Subject: Re: An API for Airplane mode on iOS?
- From: Alex Zavatone <email@hidden>
- Date: Tue, 09 Feb 2016 13:38:27 -0500
On Feb 9, 2016, at 12:15 PM, Jens Alfke wrote:
>
>> On Feb 9, 2016, at 4:17 AM, Alex Zavatone <email@hidden> wrote:
>>
>> I’ve created multiple tests using reachability and it would be REALLY EASY if we could simply respond to changes in the Airplane Mode switch.
>
> This triggers changes in network interfaces that you can detect using the SystemConfiguration framework.
> It _should_ result in a reachability notification, but you’re implying it doesn’t for some reason, right?
> There are lower-level SystemConfiguration APIs that can tell you about network interfaces going up/down.
What is happening is that edge cases are coming back from the client and every edge case is another case to fix and test, which requires to much turnaround time.
I already removed a race condition where a "start a connection" message was sent out when the reachability of the network interfaces had changed to "I am not returning 0", but this did not guarantee that the internet connection has renegotiated its IP and could reach our target web services yet.
Simply put, if we can detect that this user is has turned off Airplane mode, we can respond in a more cautious manner.
The underlying code is wrapping several layers, each with its own "is the network available" internal ivar and/or property.
You've pointed me in the right direction, Jens. If I have the time to fix it, that's another matter.
I do have an, "I don't care what changed, can this device reach this IP through any means?" method set up. It's just the underlying layers of PTSD inducing fragile spaghetti code that simply aren't safe to try and change that lie underneath… waiting to bite the poor soul who thinks they can modify them.
I'll take a look at the system configuration frameworks.
Cheers and thanks again.
>
> —Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden