I have an app need to query iPhone hardware parameters, such as model, color, size of storage, active date, given serial number or IMEI. Is that possible? Is there some sort of HTTP API I can call?
No this is not all possible and especially not via HTTP API.
In a native app you will be able to get the model, screen size, size of storage, current date and os version. But any unique identifier are not accessible any more.
Related
I'm developing Facebook app on iOS, Android and Web. I want to get user's current country and protect it from manipulation?
This function has to be practical across mobile app and web app. and can't be manipulate by the user(it has to show the real country they are currently in and they can not change it).
How can I do that?
Can I use Facebook App to get user Location? is it the real location or it is just a location the user has written on their profile?
Generally speaking, getting accurate geographic information can be done using a few techniques.
GPS positioning
This is done on the user's device, therefore it can be faked and can't be trusted. For example, the Android official emulator allows the user to input arbitrary data for testing purposes.
GeoIP
Assuming the user can connect to a server through an IP network, he will have an IP address. Then on the server-side, which you control, you can query one of the existing GeoIP databases to get an estimation of the user location from the IP address.
While you are the one looking up the country code, it can be faked for example through the use of a proxy server located in a different country.
Device language/country
It is doable for example on Android via the use of the telephony API:
TelephonyManager manager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String countryCode = manager.getNetworkCountryIso();
I'm not sure it is easily modifiable, however this is by no means a portable approach, especially for web applications.
In the later case, the accept-language HTTP request header can be used, since browsers usually advertise the user's favorite language. While not accurate, it can still give an estimation of the user's country in the case the language is unique to a country.
Just as every user-supplied information, it still can't be trusted though.
Bottom line
There are very few guarantees that a user's geographic information is accurate, especially since the advent of country-protected multimedia contents represents an incentive for people to actively find solutions to circumvent such protections.
It seems that we can get iphone information, such as ICCID, active date, color, storage size and so on, by serial number or IMEI on apple's website before. But this is not allowed these days, at least by apple's public website.
But I found an APP that can do this. It just use serial number to get all these information including the phone number and mobile operator. So I think apple's website still have this kind of API/service. Anybody knows?
I want to find iPhone devices/device tokens within a specific radius from particular location.
For example : Within a 25 K.M. of radius from Sydney,i want to get iPhone devices tokens.
I am working on ASP.NET MVC2 for this.
Let me know,if is there any API for that?
Thanks,
You are only able to get details for devices that you 'know' about. Your app will need to log unique IDs for each device, and your app will need to log known locations for devices. It's then up to you to look up, from your central database, the details of the devices within a certain distance. iPhones can update significant location changes when running in the background but it's up to you to track devices and accept the limitations that that data may not always be correct. eg. If a user falls outside connectivity then you will still have an old location logged for that user.
I'm not aware of a single API that offers this services, if you're coding it then in your app you will need to register devices identifiers and location information to a central server. You will also need to create the lookup to query your data to find devices within a location. I am guessing that you might want to send push notifications, in which case your app will also need to register for notification services too.
There is no way for you to discover devices that don't have your app running and you also do not know who the owner is.
As par my app requirement, there is a couple of scenarios that I need to handle.
Scenario 1: To avoid piracy, I want to include some piece of code, whose job is sending both IMEI and Serial number of IPhone.
Scenario 2: At server side, I've a database, which has a list of both IMEI and Serial No info. Here I wanna validate both IMEI and Serial numbers. If both are not matched then I can make sure that the app is pirated.
Idea seems good. But I don't know how to handle these two scenarios in my app.
Any help is greatly appreciated.
This isn't something you can do with the iPhone SDK. The iPhone's IMEI or the serial number are not accessible via any API. Also an iPod Touch doesn't even have an IMEI.
Your idea is flawed too. How would you have gotten the IMEI and serial number into your servers database prior to app sending you the details? You can't get these details during purchase because its handled by the App Store and you can't get at that.
If the app was pirated, it would send you the IMEI and serial number anyway, so you can't rely on the app sending them the first time it's run because that would offer absolutely no protection against piracy at all.
The only option you have is to rely on Apple's fairplay DRM. Even though it has been cracked, and there are pirates, it's something you just need to deal with...
There was a hack for previous firmware using a reverse engineering of Code Telephony but it does not work anymore.
As far as I know, you can only get the UDID on the iphone.
[UIDevice currentDevice].uniqueIdentifier
A unique device identifier is a hash value composed from various hardware identifiers such as the device’s serial number. It is guaranteed to be unique for every device but cannot publically be tied to a user account. You can use it, for example, to store high scores for a game in a central server or to control access to registered products. The unique device identifier is sometimes referred to by its abbreviation UDID.