Current country's emergency telephone numbers using location - ios

I have been trying to find an API which gives the current country's emergency contact number (i.e. for US 911, India 100,101,102).
Is there any way to get the emergency call number using my current location?
I already checked Programmatically making an emergency call on iPhone, but it does not return the current county's emergency number.

There is no API in Cocoa Touch to get such information based on user's location

Related

Update user's location in background (iOS)

I'm building an app that takes the user's location and checks if he's near one of his friend's house (all the friends addresses are stored in NSMutableArray from his contact list), if he is, it sends him a push notification.
Now, I'm trying to figure out how I can get the user's location when the app is in the background (and even after the user killed the app from the multitasking screen).
I need to analyze his location and check if he is near one of the addresses on the array.
Does anybody know how can I get the location? Thanks!

How to get a country code from the given phone number

I have two phone numbers +17896786788 and +322657579849. I would like to retrieve only the code I.e, +1 and +322 by passing these phone number.
Is there any API avalable to get the code out of phone number?
libphonenumber gives the country code for the given country. Link: libphonenumber ios get country code for country
But I would like to get the code out of phone number.
I spent a long time investigating this, and so far there is no way to do this on iOS.
Sure we can make a guess, and it would work in most cases, but there is always some cases where it will be difficult, let me give you a few exemples:
Canada and USA share the same international prefix: +1
Martinique is part of France, but has its own international prefix: +596
Taiwan can be considered part of China or not depending on the user's interpretation
And the list goes on..

Making a faux iPhone dialer

I want to make a joke application for a friend (not for general sale) that looks exactly like the iOS Phone application but so that whatever number is dialled into the application it appears to dial that number but actually dials a preset number in the background.
The way I figured to do it would be through the following:
User enters a number and hits the call button
Save the number entered as a contact's name and programmatically set the number of that contact as the preset number
Get the application to ring the preset number, to which it would switch over to the real iOS phone application and dial, but with it being a saved number in the contacts it will display the name, which is the number entered by the user.
Delete that contact upon re-opening the application as for it to not ask which number to dial the next time.
This is the only way that I can think of pulling this off, but it seems like it will look unconvincing; especially when it switches over to the real Phone application. Can anyone think of a better way? Such as calling from within the application?
I wouldn't usually take junk requests like this but it made me curious as to pull it off best.Thanks
If you are not going to publish this, then there is no reason why you shouldn't use private apis. See this answer (How to directly make a phone call with private API CTCallDial()?)

Can I get POIs using Map or Locate SDK in iOS

POI: Point of interest(http://en.wikipedia.org/wiki/Point_of_interest)
Is there a iOS api which I can use to get a list of POIs near a user location? Here's what I want - the user enters a search term and I already know his latitude and longitude. I want to get an list with the POI details based on the search terms.
So lets say I search for Starbucks at a particular location, I should get all Starbucks within a radius of say 5 miles from where I am.
Can iOS API do this?
Not natively within iOS, but you can use a third party provider, such as YellowPages.com.
http://www.yellowapi.com

User current country - based on current location of the user

I would like to check in which country the user is - I have tried a few ways but none give the requested result. My main goal is when the app launches check in which country the user is and based on this by pressing a button call a different phone number, For instance user can be in Canada use the app and by pressing the button dial an XXX number and next week with same Iphone be in the US and by pressing the same button dial a YYY number.
I have tried using CoreTelephony but this is good only for 4.0 and up i want my app to support earlier versions of iOS also tried Geocode but i do not want to display a map in my app.
Any guidance will be appreciated.
Get your current location and reverse geocode it.
Get your current location using CLLocationManager. Reverse geocoding is supported by iOS SDK 5, so if you need support versions below 5.0, you need to use external geocoding service. For example, Goolge Maps Reverse Geocoding, that is described in details here: http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding
What you need to do, just send a request like below:
http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true and you'll get back a JSON with formatted address components.

Resources