Iphone WIFI "call home" function? - iphone

We're deploying a Wifi hotspot service in some locations via unifi. You have to sign up with your mobile number and get an sms which includes the activation link.
The Problem is:
The iPhone seems to check the connectivity of a WLAN to the internet. So, after you sent your number, and before you clicked on the actvation Link, theres no Internet Connection (Basically it is, but youre not allowed to get outside of the Internal network until activation Link has been clicked).
The Iphone recognizes this and disables the WiFi, because it can't contact his "Testserver" - so you are on 3g again, and the activation Link isn't reachable anymore.
My Question:
Does anybody know to which IP the Iphone tries to connect before it deactivates WiFI?
So i could Whitelist this IP to be reachable without authentication, so the Iphone wouldnt disable Wifi by itself anymore.
I've tried to catch it up via wireshark, but i didnt see anything. :(

Related

give Google Assistant device commands programmatically

Is it possible to give Google Assistant commands programmatically? For example, I'd like to be able to send a command as text "turn on the fan" and have GA react as if that was the spoken command. I would also accept sending a JSON request in whatever format needed (with device IDs or whatever the API needs).
My situation is I have a ceiling fan that is controlled by Google Assistant. I want to be able to control it programmatically. For example, some event happens and my code wants to turn the fan on. Is there any way my code can tell GA to turn on the fan?
I tried using the Google Assistant SDK. I can send it text like "what time is it?" and get back text and audio, eg "It is 11:00am". However, I have a test device called "washer" and if I send text "is the washer running?" I get back "Sorry, I didn't understand". If I speak the words into my phone, I get back "The washer is running".
Why can't the GA SDK interact with my device? The credentials I give to the GA SDK are the same I use for my SmartHomeApp that defines the "washer" device.
To do this, you can setup up a virtual Assistant device and then send commands to it.
Check out Assistant Relay, which is a service that sets up a virtual Assistant device and exposes a REST API so you can send text commands to it, as if they were spoken.
Per the Documentation:
Simply send Assistant Relay any query you would normally send Google
Assistant, and Assistant Relay will call the Assistant SDK an execute
your command.
Per the problem you are having with the Google Assistant SDK, I believe what you are trying to achieve is only possible with a device, be it physical or virtual and not by using the SDK directly.
There are a lot of firewall and security issues allowing each smart device to to connect to the Internet. To alleviate this problem, Google's design methodology uses a fulfillment device as a bridge to connect to the device locally from one of their devices.
You are locally, on your smartphone, hooking into Google Assistant.
The phone is the fulfillment glue for the "washer" device.
According to this page:
Google Home or Google Nest device is required to perform the
fulfillment.
Due to the portable nature of cell phones, it does not make sense to allow one to be used as the fulfillment device remotely, hence the local hook.

Obtain WAN IP address from Google Assistant Webhooks

During the Account Linking of our app with Google Assistant, we authenticate the user by mapping its WAN IP Address.
Once Webhooks intents are received, they are coming from Google cloud, not the user device, so the WAN IP doesn't match. It's then impossible to know if the user is still at home.
It seems there are ways of obtaining user and device identity, like name or device location. Is there a way of obtaining the device WAN IP address?
(à la x-forwarded-for).
In short - no.
The Assistant platform is meant to allow users to, somewhat transparently, move from device to device. The device ID isn't even standard.
If you need to know their location to make sure they haven't moved, then you can ask for their physical location. For speaker devices, such as the Home, it will use the device location that was set by the user, but for mobile devices it will use the GPS.

Give access to the AppStore in a WiFi HotSpot

One of our hotel clients provide free WiFi to its guests with a Hot Spot, however, there are available only a few URL to access them freely (such as Facebook or the website of the hotel) and if you need more access you should log in.
We have developed the App for the hotel and one of its features is that if you open the App it gives you a complete access to the hotel WiFi, so you can navigate to any page you want.
Therefore, it is necessary that the guests can download the app through the AppStore without being logged in to the hotel WiFi, so the guest can download the App and get the access immediately.
We have a trace of the URL that calls the AppStore for search and downloading the App and we have set the Hot Spot to allow access to this URL, however, the AppStore tells us that we have no connection.
What URL should we need to enable in our Hot Spot for the AppStore to work properly?
These are the routes that have enabled:
search.itunes.apple.com
play.itunes.apple.com
init.itunes.apple.com
su.itunes.apple.com
itunes.apple.com
se.itunes.apple.com
p59-buy.itunes.apple.com
pd-st.itunes.apple.com
xp.apple.com
sp.itunes.apple.com
Thank you for your help.
Apple Appstore communicate using HTTPS. So router in the middle will not know what url that been use by client due to it's encrypted.
The solution is, instead of allow those by url. you need to allow it by ip address.
I would suggest to allow connection to the following address.
17.154.0.0/16 Apple's Class B Subnet includes phobos.apple.com address(es)
23.63.98.0/23 Akamai Technologies CDN
Please keep in mind that xxx.xxx.xxx.xxx/16 mean 255.255.0.0.
And it will be equal to allow ip adresss from 17.154.0.0 - 17.154.255.255
Also Akamai is a Content delivery service So ip address will various from location. I would suggest you to try to ping swcdn.apple.com get ipaddress and allow those /23 server.

Detect if iphone/ipad connected to VPN via public wifi programmatically

We have an app wherein certain functionality needs to work only when the user is connected to a router associated with his account (we have some information about user accounts and home routers).
However, it is possible for the user to set up a VPN connection to his home router via any public wifi/3g network. We want to block certain functionality if that is the case.
Any ideas as to how it can be detected using any of the existing iphone/ipad apis?
Thanks,
Hetal
There is a flag in the reachability API called kSCNetworkReachabilityFlagsTransientConnection.
It is true when you are connected via a VPN and false if you are not connected via a VPN.
We used this flag value to check for our conditions.
There's no iOS API (public at least) that is going to give you information on whether you're running on a home router or public WiFi connection. You can only determine that you're on a WiFi connection vs. 3G. (for example, see the Reachability sample)
You might be able to do some sort of lookup based on the device's current IP address. You'd have to have each user register their router's IP address and have your application validate it before running, etc. But still, there'd be no guarantee that user's home router is secured. In other words, it could be just as wide open as a public WiFi.

iPhone NSURLConnection pop-up for entering user/password requested?

I observed in a Hotel I am that when other apps trying to access the internet a pop-up appears that ask the iPhone user to enter the user id and password of the Hotel's Wireless LAN. I guess it is some kind of redirect on all requests to protect misuse of the WLAN.
I have an app and it does use the NSURLConnection but I am not getting the pop-up instead it goes via the regular data network of the carrier. I removed the SIM to see what happens then and then the connection fails with an error "The Internet connection appears to be offline".
I wonder whether this is because the NSURLConnection does not provide such a pop-up and this other apps (e.g. Safari, e.g. WhatsApp) use a different API. One the other hand I thought that might be what the documentation says is the "Authorization Challenge". I have implemented those delegate methods but they are not called.
If someone with some experience on this can help me.
Search the documentation for the UIRequiresPersistentWiFi Info.plist key - there are some tradeoffs (users will get an alert every time they open your application if their phone is in Airplane Mode - doesn't seem to be any way to turn that off) but that should force it to make the connection.