Find iPhone devices/device tokens in specific radius :- - iphone

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.

Related

Can we make our own Find My iPhone app

I am thinking to make my own app like Find My iPhone app . But I am confused that whether apple allow developers to have access to play with the security or is there such Apple API's that can help us to include features as in the above app. Any suggestions?
Well I just can't comment because of low reputation. But people must give a reason to down-grade a question. Its quite a valid question.
Creating an app like this is semi possible. Due to the fact that you are not allowed to keep running in the background, except for certain special cases. Such as Music or a guidance app (navigation apps)
Your app can register to receive updates from the GPS location and process them.
The problem is it will use your gps all the time.
The find my iphone app is a combination of wifi location/sim card location/gps location.
It uses a combination of all these items which it has to keep track of your location as close as possible. Now back to your question, the fact that you cannot keep running in the background, will mean the app needs to stay open all the time (open I mean running, not necessarily onscreen). Not like the application from apple itself, which of course is allowed to go outside these developer restrictions.
The APIs exist for you to create the main functionality of this app. Core Location and APNS
When use A is looking for the location of user B, A would tell a server that it needs user B's location.
A push notification could fire up user B's app, at which point...
User B's location services would kick in, in the background,
Send this information to your server
Then update user A with another push notification.

iOS api for real time traffic data (like geoloqi and Waze)

I have been visiting some services api website but can't find what I am looking for. My question is more aimed at what resources to use rather than how exactly it should be done.
My iphone app requirement is to be able to track users that are nearby, are commuting and locate them on map. Additional requirement maybe texting them, call them, have video session with them etc. On a high level, this will convert to something like
get user details based on longitude and latitude
get to know if they are registered users of the service subscribed
Sending message to user/users
Call user using iphone phone api or dedicated app session
Video call
Waze is one of them. While it is open source, there is quite less documentation on how one can use it as backend for real time traffic data.
Then there is this Geoloqi which is paid, but has iOS SDK as well as rich api. However I cannot find sections that are useful to me when I look up to my requirements listed above. What I believe is that there must be many apps already relying on such a useful service. If any of them are open source / tutorials, it would be most useful resource for me for feasibility of geoloqi. Geoloqi also charges users for using their api, so it is also important for me to know what features come at what price .
For the level of data/information your interested in, and the functionality, you should just make your own app, I dont think you need those APIs.
You can find and send the coordinates of the people who are using your app to your server. Then you need to determine the distance between them, to see if they are in the zone of talking, or whatever other functionality you have listed above.
To determine the distance between two people, This answer should be helpful: Calculate distance between 2 GPS coordinates

iPhone alert an alarm if stolen

We are developing an enterprise application .The phones are connected to a Wifi router. The objective is to trigger an alarm if the phone moves out of the secure area .. (outside the building)
What is the best way to check if the iPhone is always inside the building .
some of the options we tried are
1.using Wifi(continous ping to wifi network),if not trigger an alarm .
2.if coordinates change (using GPS)
Are there any other means to achieve this .
You can use Location Services in iOS 4 (with the background location feature) to determine when the phone has moved to a different location.
#indragie's idea of using Location Services is a good one. If you can be sure that the WIFI SID isn't going to change, you could probe to see which access point the iPhone is currently associated to. If you are going to ping, then a better approach is to make the system service agnostic, and simply issue an HTTP query on a regular basis to your enterprise server. The server can then have a policy language on it declaring acceptable access points (from a variety of metrics). This might be set up to allow people to take their iPhones home.
Your best bet is GPS as the phone will not be able to find its location if you rely on WiFi and the device is not connected to a WiFi network.
Check out Apple's documentation for Location Awareness capabilities here http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/LocationAwarenessPG/CoreLocation/CoreLocation.html
You will be able to track "significant" or standard location changes in the background, details can be found here http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5
[edit to include]
This might be of interest to you too - http://longweekendmobile.com/2010/07/22/iphone-background-gps-accurate-to-500-meters-not-enough-for-foot-traffic/
It depends on what you want to do. Just to let the iPhone user know that he/she is moving away, using Location Services is good enough.
However, if you want to have a server that makes sure all the devices are within range, then it's more complex because your application may get suspended without a notice from a background state; in other words, you may not be able to catch the moment when your application terminates and take appropriate actions. Therefore you are going to need a heartbeat system like pinging to the server in this case.

iOS: Send GPS Location from one device to Google Maps on another?

Can you send your currently location through the iPhone SDK to another iPhone and have them open up your location in Google Maps?
The only way I can think of is through text message, but I'm not even sure that would work.
Any ideas?
It'd be easy to set up a webserver to relay the message.
User 1's iPhone sends the phone's location to the server, which stores it in a database. User 2's iPhone periodically polls the server for the latest location of User 1 and displays it on screen.
You'd have to work out a good system of limiting which users can access whose data and so on, but otherwise it's a pretty straightforward project.

Request routing on iPhone/iPod without GPS

I want to build an iPhone App that should contact a server that is nearest to its location.
The app itself knows where the servers are located and it should find out which one to choose.
Because I expect many users with an iPod touch I can't use GPS to do this.
On StackOverflow and ServerFault I found this possible solutions:
Use Anycast technology to route users => I can't use this method because the device itself should route the requests and know where they are going.
Get country code and use the Google Directions API to determinate which server is nearest.
Get location by IP (GeoDNS etc.) and do the same (see above).
Method 2 seems good but I have three questions to that:
The API sends me the whole route from point x to point z. I just want to have distance. Is there a way to do that?
Google says they have a usage limit of 2,500 request per day. How do they control that? By IP? I ask this because they say you don't have to use an API key - how do they control then?
Is is a good idea to use Google without having any trouble later? My app itself will be free but I'll have In-App Purchases in it. Does that matter?
I hope somebody has experience in this. Thanks in advance!
Paul
In many cases, iOS will still return a location when requested on devices without GPS. Remember, the first generation iPhone didn't have GPS, but could still do location based services. iOS will use a number of techniques (IP geolocation, skyhook, etc) to find the location of a user, in addition to GPS.
Anyway, to answer some of your questions:
The 2,500 requests per day is per end user, or typically per IP address. So you shouldn't need to worry about getting capped. You should however be aware that you need to display a Google Map to use the API, so if you're using their API and not using a mapView you may have an issue.
I'm not entirely sure why you would need to use the Google directions API in the first place. If you can get lat/lon coordinates of both the user's current location and your servers you can just use iOS's built-in CoreLocation methods to get the distance between them, and decide accordingly ([CLLocation getDistanceFromLocation]).