Skip to content
View in the app

A better way to browse. Learn more.

Universal Devices Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Detecting Mobile Phone Entered and Exited WiFi Range

Featured Replies

I want to set a State var to 1 when I come into wifi range, and 0 when I go out of range. Is this doable?

I recommend using UD Mobile Geofencing. Geofences use WiFi (including access points which do not belong to you) along with GPS. If using Wifi only it may change the variable when the when the screen is off for long periods, which will cause the variable to change even when in range. Geofence lookup is usually triggered when the device connects to a WiFi access point.

  • Author
3 hours ago, Javi said:

I recommend using UD Mobile Geofencing. Geofences use WiFi (including access points which do not belong to you) along with GPS. If using Wifi only it may change the variable when the when the screen is off for long periods, which will cause the variable to change even when in range. Geofence lookup is usually triggered when the device connects to a WiFi access point.

Thanks Javi. You mentioned a couple of things:

  • "usually triggered when the device connects to a WiFi access point"

  • "(including access points which do not belong to you)"

Does "usually" mean it doesn't always trigger, when the device connects to WiFi? Or, is not predictable to when it changes the var?

Does the second part mean I can't restrict UD Mobile setting the var only when it connects to my WiFi? If so, that may explain why I didn't see a way to set my WiFi SSID. Is this not possible to limit the trigger to only my WiFi?

The attached capture is what I had set up over the weekend, but haven't seen it reliably changing var sMichaelPhoneHome - At this point, not even sure if it ever changed 🙂

Thanks again.

GeoFence Set Var.png

It looks like it last triggered at 3:13 PM as an exit, so it is working. The app's geofence logs will show all entries and exists along with any communication errors.
https://wiki.universal-devices.com/UD_Mobile#Geofencing

I say usually as the fence notification is handled by the OS, not the app. How the OS does things differs depending on may variables such as platform (iOS/Android), OS version, battery level, privacy settings, location settings, and MFG (in the case of Android). The Android App can do things to change this behavior (UD Mobile Location Services Section in Wiki), but on iOS it is mostly controlled by Apple.

The most important thing is setting, both the OS Global and App Location Settings must all be enabled or fences may not work.

  • Author
2 hours ago, Javi said:

It looks like it last triggered at 3:13 PM as an exit, so it is working. The app's geofence logs will show all entries and exists along with any communication errors.
https://wiki.universal-devices.com/UD_Mobile#Geofencing

I say usually as the fence notification is handled by the OS, not the app. How the OS does things differs depending on may variables such as platform (iOS/Android), OS version, battery level, privacy settings, location settings, and MFG (in the case of Android). The Android App can do things to change this behavior (UD Mobile Location Services Section in Wiki), but on iOS it is mostly controlled by Apple.

The most important thing is setting, both the OS Global and App Location Settings must all be enabled or fences may not work.

Thanks Javi. What you see at 3:13 pm, was done using "Trigger Exit Command" to verify the var would change. I had physically gone out of Wifi range, and back into wifi range without any change to the var. I repeated doing that yesterday afternoon, but this time I turned off cellular and used a browser to show I was connected to my Wifi, and once connected, looked at the state of the var and it was still unchanged. It's been over a day since I came back within Wifi range and still no change to the var. Repeated the test again this morning, but went a different direction - checked the logs, and they show no new entries.

I have had both the IOS global setting and app Location Settings enabled - specifically,, UD Mobile app is set to Always. Has anyone had entering and exiting WiFi range trigger when running on and iPhone, and if so, what settings did it take to get it to work?

Javi - Any other solution you can think of (other than using a beacon) to signal I'm within range? Normal geofencing has been unpredictable/unreliable, but generally close enough that when I'm near the house I should be within the geofence circle. I am outside the city and surrounded by hills, so cell towers are few, and we are relying on signals which are bouncing off of hills.

Am trying to understand the conversation here and feel like you guys are missing each others views / requests, etc.

The question as I see it is, due to poor cell phone reception, a normal geo fence (circle) doesnt work very well. So if the phone enters the WiFI range of the house, can it then trigger a variable. And conversely, if you leave the house, will it trigger.

In the question, it seems like you want WIFI connectivity between your phone and local wifi to trigger the variable, not technically the geofence.

This doesnt seem possible. When you leave the house, and you lose wifi, if you have a small geofence set up, it will still need the cell phone signal to alert the system that you have left. Losing wifi wont trigger anything.

Likewise, on the reverse, if you are entering hte geofence, cell service to wifi, it will have to wait until you are connected locally to then register you are in the fence.

The only way this would work is to have a geofence smaller than you wifi area which seems unlikely.

Javi's answers dont seem to match the problem as I am interpreting it.

@Michaelco am I reading this correctly?

On 4/7/2026 at 2:47 PM, Michaelco said:

Is this doable?

I would say no. This isn't possible with UD Mobile. As @dbwarner5 points out looks like the main point of ONLY using wifi is not supported with UD Mobile. At least not in the geofence method. I don't see a way to make wifi connection change a variable. Geofence only uses location inside or outside an area. Not only relative to if you're connected to a certain SSID/Wi-Fi.

@Michaelco the thing that I see suggested a lot of times is to set multiple geofence areas. If you have spotty service near the house a larger geofence could also be set that might have better cell coverage and set a variable when that is crossed.

I do agree with @Javi in the point that if something did only use wifi that it could erroneously trigger just by having a router go offline or a device rebooting.

Ultimately, the question needs to be what are you trying to accomplish? Perhaps use case of what you are trying to accomplish we could give suggestions of alternative methods of making something like this "work".

Ping plugin will detect a phones Wi-Fi and a program can be used to set a variable based on ping. However as Javi mentioned when the phone goes to s!esp or whatever ping may indicate you have left when you havent.

That was my experience with wifi.

48 minutes ago, TJF1960 said:

Ping plugin will detect a phones Wi-Fi and a program can be used to set a variable based on ping.

Wouldn't you need to put an IP reservation in the router for the phone then? Also, most phones (at least I know the iOS) now uses random MAC address to limit tracking. Of course those that remember to might disable this and set it to fixed for known networks, but just how many really remember/know to do that?

Then the issue becomes needing to remember to update the router/program/plugin to ping a new phone. Too many moving parts to remember.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.