Block reference / Device Management

Check network

Check whether the phone reaches the internet, and read the public IP sites see it at.

Only inWarpX Phone

Check network asks from the phone itself whether it can reach the internet, and through which address. Because the check runs on the phone, it goes through the phone's proxy when it has one, so the IP is the one every app and site sees. Use it after Phone identity or Toggle service to make sure the phone is online on the right address before an app is opened.

Check network asks from the phone, through its VPN, whether it is online and which address the world sees it at.
The Check network block's settings, filled in as in the example below.

Settings

Fail when the phone is offline

Fails the block when nothing answered, so On error in the block's settings can stop the run or take another path. Off, an offline phone only writes false.

ExampleChecked
Save whether it is online (true / false) to a variable

Writes true or false into a workflow variable, for a Conditions block to branch on.

ExampleUnchecked
Variable namewhen Save whether it is online (true / false) to a variable is on

The unlabelled box under the checkbox: the variable that receives true or false.

Exampleonline
Save the public IP to a variable

The name of a variable to receive the public IP, such as 203.0.113.45. Empty, the IP is not saved. When no address came back, the variable is set to empty text.

ExamplepublicIp
Delay (ms)

A wait after the block finishes, before the next one starts. One number such as 1000, or a range such as 1000,3000 for a random wait in that range on each run.

Example0

Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.

What it hands on

Hands on true or false as {{prevBlockData}}, and writes the two variables when they are named. With Fail when the phone is offline on, an offline phone fails the block with The phone does not reach the internet.

Example: Check that a phone is online on its proxy's address before opening an app

  1. Start
  2. Phone identity
  3. Check network
  4. Start app
Where Check network sits in the example workflow.
  1. Pick the phone in the toolbar's phone menu.
  2. Add a Phone identity block that puts the phone on its proxy.
  3. Add a Check network block. Tick Fail when the phone is offline and set Save the public IP to a variable to publicIp.
  4. Add a Start app block for the app the run is for.
  5. Click Run and open Logs: publicIp holds the proxy's address, not the phone's own.

Good to know

  • Three checks run on the phone: a ping to 8.8.8.8, a ping to google.com, and a request to api.ipify.org over HTTP for the IP. The phone counts as online when any of them answers, since some networks drop pings. The whole check takes up to about 15 seconds.
  • The IP comes from a plain HTTP request on port 80. A network or proxy that blocks it leaves the IP empty while the phone may still be online.

See also

  • Phone identity — Put the phone on a proxy, and set its location, time zone and language, all at once.
  • Toggle service — Switch Wi-Fi, mobile data, Bluetooth, airplane mode or location on or off.
  • Get device property — Read one fact about the phone, such as its model, Android version, battery level or IP.
  • Conditions — Send the run down one of several paths, depending on values, page elements or code.