iOS Question getmyip problem

tufanv

Expert
Licensed User
Longtime User
Hello

I am trying to use
Code: Copy
    Dim server As ServerSocket 'ignore
   Log(server.GetMyIP)

to get the ip of the user but it returns the network local ip like 192.168.x.x , how can i get the real ip of the user ?

Ty
 
This is the real ip and the only ip address that is known to the device.

If you want the external ip address then you need to use a web service that will return it.

Example:
Code: Copy
Sub GetExternalIp As ResumableSub
   Dim j As HttpJob
   j.Initialize("", Me)
   j.Download("https://www.myexternalip.com/raw")
   Wait For (j) JobDone(j As HttpJob)
   Dim res As String = ""
   If j.Success Then
       res = j.GetString
   End If
   j.Release
   Return res
End Sub

Call it with:
Code: Copy
Wait For (GetExternalIp) Complete (Ip As String)
 
Upvote 0
Back
Top