1

Is this even possible? I couldn't find code on how to do it. When not on Wi-Fi, the device IP keeps changing, & I need to keep track of that.

2 Answers2

2

You can use Rechability and schedule some timer to check whether any change occurred. It will looks like that and this.

For retrieving IP address you can try this code.

If possible test with a real device not a simulator as it probably will not be working properly on the simulator (once I tested sth similar and it failed on the simulator while worked perfectly fine on the real devices).

Community
  • 1
  • 1
Julian
  • 9,299
  • 5
  • 48
  • 65
1

Not sure that is possible directly, but using Reachability to catch every network reconnect you can get new ip each time.

sage444
  • 5,661
  • 4
  • 33
  • 60