I would like to get the IP Address / hostname / device (ios, android, web) for a specific tweet via Twitter API or anything similar.
Is that possible ?
There's absolutely no way to get IP address or hostname. That would be a massive privacy violation.
You can make a very rough guess at device by looking at the source parameter of a Tweet.
If it says "source":"Twitter for iPhone" you'll know it is coming from an iPhone. Not every source says which device it is running on.
Related
According to this, there is no easy way to tell the exact location of an IP address. So, when I visit Google Maps on my laptop from my home wifi, how does Google show me the exact location of my house ? What additional information does Google use to track me down ?
Instead of IP address geolocation, your browser might have WIFI geolocation enabled. It will pass the router MAC address to Google to find your house location. Google has a lot of Android device with GPS enabled to verify the location.
My requirement is like, I want IP and MAC address of devices which are connected to my iOS device's hotspot.
How can I get a list of IP address of those devices?
Does Apple allow to get hotspot related information through code.?
Unfortunately I don't know a way to get the actual client list (or ARP table for that matter).
But you could implement a scanner. Have you thought of that? Isn't the beautiful solution you're most probably looking for, but might be something?
Here would be a scanner library as reference: https://github.com/mavris/MMLanScan
You could also get your devices IP address and network mask, calculate the possible IP range yourself and implement an ARP query per candidate device using sysctl and gethostbyaddr as described in this post
https://stackoverflow.com/a/2269903/1041122
EDIT sidenote:
Did you have a really deep read of the NetworkExtension API from Apple? I don't know it well but since it allows numerous configurations that might be possible as well.
Use Case:
We have an iOS application where you can run a network test between an iOS device and its associated wireless access point to test throughput. The app can get the IP address of the iOS device just fine, but the user has to type in the IP of the access point.
Problem:
The task is to get the IP address of the associated access point, and pre fill it for the user, hence avoiding user intervention there.
My Approach:
Find out the Mac Address/BSSID of the access point.
I do this by employing the Captive Network API.
Issue an ARP request to find out the IP associated to the access point.
I haven't been able to accomplish this as of yet. Google and SO search has kind of lead me to a dead end here. Here are some similar questions:
How do I query the ARP table on iPhone? AND
ARP Requests on iPhone
Question:
What is the right way to do this? In fewer words, what is the best way to get the IP address of the access point an iOS device is connected to.
A WiFi access point is not necessarily an IP-capable device (although many of them are, but for configuration, not communications, purposes).
Even if you do get the actual access point's IP address, how are you going to test the throughput? You could send ICMP Echo requests, but that will just give you instantaneous round-trip times, not throughput, and many IP devices, for security reasons, are configured to not respond to ICMP ECHO requests.
BSSID is unique for each SSID on each Radio and it differs from the Access Point’s Mac Address. If you compare them you can see last characters of Mac Adresses are different for BSSID and the AccessPoint.
So I need to retrieve the user's WAN IP from within the app I am building. I saw this answer here:
iPhone/iPad/OSX: How to get my IP address programmatically?
But this only returns the user's IP address in the local network.
By what means can I know the user's WAN IP from within the app?
The easiest way to get your wap ip address is to use NSURLConnection.
For the URL you can use: http://www.whatismyip.com/m/mobile.asp or http://www.dyndns.org/cgi-bin/check_ip.cgi
Just parse the return data and you have your external ip address. A complete implementation is shown here. It is not the most efficient way, but it works.
How can I get Carrier and IP Address and Device Id on J2ME?
There is no standard way to get these information on JavaME however on Nokia platforms there are some Nokia specific system properties that you can use. com.nokia.mid.imsi and com.nokia.mid.networkid may be interesting for your case.
For the IP address I suggest that you use a server side call to retrieve the IP address from referrer.