1

I am developing a React Native apps to automatically clock in/out users when they near office.

I intend to use WiFi as a method to verify if user is at the location or not. MAC address should be a unique and fixed identifier that can verify if user is here.

If using SSID / wifi network name, user can just alter theirs at home to match the office one.

From here, it seems like it's not feasible anymore? How can I programmatically get the MAC address of an iphone

If it's impossible to get MAC address from apps in iOS due to security concern, is there any way I can achieve this? To correctly identify a specific wifi network it's connected to?

Darren
  • 165
  • 3
  • 9
  • you need to implement Geofencing. – Bhavesh Nayi Apr 30 '19 at 06:48
  • I'd never work for that kind of company :D – VilleKoo Apr 30 '19 at 07:23
  • Geofencing is one of the way we are working on. But that need user to turn on accurate GPS tracking etc and might not be accurate too. So I thought connecting to office wifi would be a pretty reasonably accurate, fast method to help employee to automatically clock in / out – Darren May 08 '19 at 01:00

1 Answers1

0
if let interface = CNCopySupportedInterfaces() {
    for i in 0..<CFArrayGetCount(interface) {
      let interfaceName: UnsafeRawPointer = CFArrayGetValueAtIndex(interface, i)
      let rec = unsafeBitCast(interfaceName, to: AnyObject.self)
      if let unsafeInterfaceData = CNCopyCurrentNetworkInfo("\(rec)" as CFString), let interfaceData = unsafeInterfaceData as? [String : AnyObject] {
        // connected wifi
        print("BSSID: \(interfaceData["BSSID"]), SSID: \(interfaceData["SSID"]), SSIDDATA: \(interfaceData["SSIDDATA"])")
      } else {
        // not connected wifi
      }
    }
  }

P.S. I took that from iOS get current wlan network name

Paul T.
  • 4,938
  • 7
  • 45
  • 93
  • Is that possible not to identify using SSID? I think if using SSID / wifi network name, user can just alter their WIFI at home to match the office one. Is there any other fixed, permanent ID for WIFI that we can use it to authenticate? – Darren May 08 '19 at 00:58
  • I don't know about that – Paul T. May 13 '19 at 11:58