How to get the external ip in Objective-C

前端 未结 3 1406
萌比男神i
萌比男神i 2020-12-06 07:41

I looked for some code that will help me to get the ip that the iPhone connect with.

I find this one:

- (NSString *)getIPAddress
{
    NSString *addr         


        
3条回答
  •  忘掉有多难
    2020-12-06 08:24

    Have a look at the example in my second Answer here.

    In a nutshell it uses *http://www.dyndns.org/cgi-bin/check_ip.cg*i to get the extenal I.P

提交回复
热议问题