I noticed the note on the app store submission tips stating that an app that relies on internet connectivity should have some checks to see if the user is online.
I used the following code alone with a lebel to show the user the status (I'll report back if this app gets approved in the store)
The problem I have is that it seems to return EMPty initially, even when there is a connection (only meant to return that in airplane mode). Also it doesn't seem to fire an went on my iPad when connected to wifi only (no 3g) and I turn off the wifi router. <shrug> they do say it's experimental in the IOS release notes I guess, but if it's mandatory for an app store release it's a bit of a worry.
So my code is something like
Code: Select all
on OpenCard
iPhoneSetReachabilityTarget "http://mydomainname.com/"
end OpenCard
on reachabilityChanged pHost,pInfo
if pInfo contains "connection required" then
set the text of field "labelConnectionOnline" to "Connection required"
else if pInfo contains "intervention required" then
set the text of field "labelConnectionOnline" to "Connection required"
else if pInfo contains "reachable" then
set the text of field "labelConnectionOnline" to "Connection Ok"
else if pInfo is empty then
set the text of field "labelConnectionOnline" to "Are you in airplane mode?"
end if
Many thanks, look forward to hearing from others as I'm quite new to live code.

Dale