0

Is there any official way to get the IP Address of NIC ?

I found a way with the use of getIfAddrs. But it seems that it is not mentioned in SDK. So is the risk (banned by AppStore) high ?

Thanks.

SkyEagle888
  • 1,009
  • 2
  • 18
  • 42
  • possible duplicate of [Finding local ip address in the iphone](http://stackoverflow.com/questions/527439/finding-local-ip-address-in-the-iphone) – Brad Larson Dec 06 '10 at 17:24
  • See also [Find IP address in iphone](http://stackoverflow.com/questions/2361345/find-ip-address-in-iphone) and [How do I query the iPhone's current IP address?](http://stackoverflow.com/questions/260484/how-do-i-query-the-iphones-current-ip-address) – Brad Larson Dec 06 '10 at 17:25

2 Answers2

1

Speaking to the use of getIfAddrs(3), as a BSD system call, it's not a private API, so its use should not be prohibited in any way.

Shaggy Frog
  • 27,575
  • 16
  • 91
  • 128
0

never tried before, but i kept reference of this function to retrieve ip address. it might work

http://blog.zachwaugh.com/post/309927273/programmatically-retrieving-ip-address-of-iphone

HelmiB
  • 12,303
  • 5
  • 41
  • 68