I am developing an application in which i need to know which are already installed in iPhone device such as google maps. I need to check it. cause I know some country can't support google maps. In this case, what can I do that?
Normally you can't unless you find an API. And even if you find it, there are chances you get rejected from the AppStore.
However, you can try with the URL schemes. For Google Maps, it will invoke the application of it finds an URL starting with http://maps.google.com/.
So, add this function to your code :
- (BOOL)isGoogleMapsInstalled {
return [[UIApplication sharedApplication]
canOpenURL:[NSURL URLWithString:#"http://maps.google.com/maps?q=Paris"]];
}
It's not very "clean" but should works.
Related
I am building a site that will have address links as well as image of a map - both of which have a link to Google Maps.
The problem is that when I click on these links using my iPhone - or any address link that shows up in an email, the result is that either the native Apple Maps app opens or the Google Maps in the browser. I want for the native Google Maps app to open every time, and ideally for every user (whose iPhone I have no control of).
If I use the Chrome app for iPhone, then there's a little trick to do this:
http://www.redmondpie.com/how-to-set-google-maps-for-iphone-default-app-for-opening-map-links/
But the reality is that the trick above will not open the Google Maps app. It will open the web version of Google Maps inside the Chrome app. Then an icon shows up at the bottom asking if you want to open the native app instead. This is better than nothing, but far from ideal. I appreciate any help. Thank you. BTW, I'd like to do this without jailbreaking the iPhone - I'm looking for a solution that will work with other people's iPhones.
You can use apple's interface which is a bit more intelligent when using different browsers and devices:
http://maps.apple.com/?q=51.507269,-0.127695
Clicking the above url on the following devices:
iPhone|iPad:
Opens Apple maps app
Android:
Gives you a choice to open in either Google Maps App or Google maps website
Windows Phone:
Opens Google maps mobile website
Windows 8 Desktop:
Opens Google maps website
Apple OS Desktop:
Opens the new maps app (Mavericks)!!
For more info see:
Apple URL Scheme Reference
To open Google native app you need to write:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"comgooglemaps://"]];
Example :
comgooglemaps://?q=Pizza¢er=37.759748,-122.427135
I just tested this and it worked in pulling up Google Maps instead of the default Apple Maps application.
Testing Maps
However, after deleting the Google Maps app for iOS, the link fails to open anything because that schema is no longer available and doesn't fallback to a generic maps link... almost seems like you would need to provide two links for Google Maps for iPhone and another generic Apple Map link...
Take a look at this.
It works on every device (for ios / android, it will launch google maps app else browser).
For other devices, it will launch browser.
Simple use case would be:
Construct universal map URI (with encoded params)
Use this URL like -
window.open(mapUrl, '_system');
More info for window.open here
My use case required to open existing in app map navigation into some another dedicated maps app (preferably google maps app) for ios and android devices.
I use ionic v1 + cordova for building native apps. Not sure if this is perfect for your use case but hope this helps.
I'm learning iOS programming. I was wondering if there is any way to show the icons of all the running apps in the phone. I know how to get a list of apps that are running currently, but is it possible to access their icons?
If not, what is the best way to do this? Crawl the appstore for icons and store it in the app?
As far as I know there is no API for getting the current running apps in iOS (but there is something like this for Android).
If you want to show only the currently running app icons, how will crawling appstore help?
If you cannot do it directly through some API trickery, how about a sideways workaround? If you know the names of the apps that are running, you could build a process that grabs the app icons through the iTunes Store Search API (using NSData's initWithContentsOfURL: method (docs), or with NSURLConnection and its delegates).
It might be a bit convoluted, but is probably the most straightforward way of getting the icon of any app that might be running.
I have tried to grab app icons using the API and I make it!
Take an example of app yelp, the premise is you get the buddleid of this app, which you can refer to Finding list of installed apps on iphone
And https://itunes.apple.com/lookup?bundleId=com.yelp.yelpiphone
helps to get the information in the form of json. Use the value for key "artworkUrl60" to get the icon of yelp
I am developing an application in which I need to find the apps which are already installed in iPhone device such as Skype, facebook. I need to check it. Please give me code snippet if possible otherwise a link to get the solution.
If this is possible, then how to disable the app also?
You can't check for any application, but you can actually check for applications which officialy shared their url scheme.
You can find the biggest database of those url schemes here. Now, how to use? All that we'll need is UIApplication. First, we need check if the iOS can open specific url:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:#"fb://profile"]];
If this method returns yes then the user has the facebook application installed. To open the following application you need to call:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"fb://profile"]];
Which will open your Facebook profile on the Facebook application.
Alas, there is no possibility of disabling any other application on the iOS, since each and every third party software is being sandboxed.
Tapbots does something similar but only with their own apps. They probably keep track of device UDIDs on a server of theirs by communicating with the server using each app, so they are able to show which of their apps are installed on a given device.
As mentioned, this only works for apps you make though, as you'll be the one programming such functionality into your apps. You cannot check the existence of apps made by others.
There are also no public APIs that allow you to disable other apps. And besides, as the others say, apps are all sandboxed to themselves.
By the way... if you're trying to disable those apps because they compete with yours... forget it. The legal implications that can and will follow are not pretty.
I don't think it's possible, as a result of being sandboxed into your own application's environment.
And I'm referring to applications in general, not applications made by you (as BoltClock mentioned), since you're referring to the facebook and skype apps, which I imagine aren't yours.
I question your reasons for doing this, especially disabling other apps. Apps are sandboxed into their own environment. Anything that breaks this would not be accepted into the App Store.
I am trying to use a URL to launch the native maps application. My build is for 3.1.3 and later. When I run the following code, safari launches with the URL instead of google maps:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://maps.google.com/maps"]];
Any suggestions?
Thanks!
It sounds to me like you are running on the simulator not hardware. This behavior occurs when the map app is not installed or if you are on the simulator.
If you are running on hardware - have you tried that same style with a specific query or location or with http://maps.google.com as the documentation you pointed to mentions that The path cannot be /maps/*. - I'm not sure if that means explicitly *. or if they mean a wildcard. I'm not really clear why you'd want to launch the map app without a specific query.
Your string needs to be #"maps://maps.google.com/...". That "maps" at the front of it is what triggers it to load the Maps.app application.
I'm trying to make an iPhone application. In it, I want to add a module to make voice call using this application (msisdn is our input). Is this possible? If so, what is the result in iPod Touch?
Any body know how to notify push registry in iPhone? I can see in some site it is available in iPhone.
Generate a call, sms, etc from iphone
You should take a look at the Siphon project:
http://code.google.com/p/siphon/
Are you trying to replace the dialer application, or simply invoke it? On official phones, the dialer cannot be replaced or have another application provide that functionality.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel:1234---"]];