Is possible to initiate a app from another in iphone? - iphone

I'm would like initiate another app which is listed in my app when user touch that app. is it possible? help me howto do that?

This isn't directly possible - the only way you can execute another application is via a URL handler.
For example, you can open a page in Safari via:
[[UIApplication sharedApplication] [NSURL URLWithString:#"http://apple.com"]];
And you get place a call (albeit with the user's agreement) via:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"tel://xxxx"]];
As such, it really depends on whether on the the application you wish to open has registered a URL handler.

With a custom URL handler, registered by the destination application, this should be possible.
http://arstechnica.com/apple/guides/2009/03/building-services-into-iphone-applications.ars

Yes, it is. Usually it is used to launch a few iPhone APIs such as Phone, Mail, Map, YouTube.
But you can use that for launching your own App that have implemented Apple URL Scheme http://www.docstoc.com/docs/3595962/iPhone-URL-Scheme. The idee is that you should create URL with some parameters for app wich you want to launch, and run it. Good luck.

Related

How can you create a link wrapped into an app Icon?

I've seen a lot of apps that can create icons for on the home screen. You add it through the normal Add on Home Screeen and when you click on the app it will directly start calling or whatever. This must be done by immediately redirecting to an url like sms:// or tel:// depending on what you are trying to do. But how is this accomplished?
How can you let a page be bookmarked normally so it will get the icon and then when it's pressed immediately redirect it to a specific url?
I THINK, these icons are made using Configuration Profiles & application links (url schemes).
Have a look at this thread: Installing a configuration profile on iPhone - programmatically
But they didn't find a solution in there. Profiles can only be installed via MobileSafari, they say. Not via a UIWebView. So i'm not sure how it's possible from native apps.
Anyhow the preference shortcuts aren't working anymore on iOS 5.1.
As soon as your app is opened, you call:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"http://www.google.com"]];

iOS URL Scheme, return to Safari when done

I would like to implement a custom URL scheme similar to how mailto works in Safari. In my html I have a link to my custom scheme (e.g., myapp://parms) which will call my app that has the myapp scheme defined. When myapp is done, I want to return to the Safari browser page. If you have a 'mailto:', the mail app has a cancel button. If you push that, or do the send, when done it goes away and the Safari page is there.
I know I am not supposed to kill my app. If I try, it goes back to home and not Safari anyway. How can I have my custom scheme app go away (hide?) when done so the calling app is back?
You could have the scheme specify a callback URL, which you open when you finish performing your task. For example,
myapp://dosomeaction?callback=http://referring-site.com
Then you would simply read the callback URL and use openURL: to go there. You could even add some extra parameters to indicate success/failure to the caller.
Your best bet here would be to pass the URL that you want to return to in the URL with the custom scheme. In other words, you would URL encode the 'callback' URL and place it as an element in the URL used to open your application.
When your application completes its tasks, then it uses this data that it received when it was opened to open the URL again using the [[UIApplication sharedApplication] openURL:yourURL] method.

Access TomTom navigation solution via URL scheme

I'm currently working on an iPhone Application which allows the user to navigate to POIs. Those POIs are defined via lat/lon, and the user should have the possibility to start his navigation solution with one click to navigate to this POI.
This works fine with Navigon, using URL scheme navigon://myapp|name||||||lat|lon
Now I know that there is an URL scheme named tomtomplus:// for the TomTom iPhone app, I'm only able to start tomtom, no other action is possile.
I tried tomtomhome://geo:action=navigateto&lat=mylat&long=mylon&name=myname - but did not work. Only tomtom app is starting.
Even when I try to go over the http://addto.tomtom.com API, tomtom does only start, no action in adding and POI or chance to navigate to.
Codesniplet:
NSString* launchurl = [NSString stringWithFormat:#"tomtomhome://geo:action=navigateto&lat=%.8f&long=%.8f&name=%#", myEntry.getLon, myEntry.getLat, myEntry.name];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[launchurl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
Any suggestions?
I used Tomtom to send me an email from the route planning option on my iPhone. In that email is a tomtomhome:geo link which I used.
To test I clicked on the link on my Mac in Safari, and obviously nothing happened. Then I saved the link as a bookmark, which immediately is synced to my iPhone using MobileMe. I clicked on the bookmark on my iPhone Safari browser and viola Tomtom opens with a map centred to the location in the link. It pops up with a balloon with the links name, and an right arrow allows me to choose first option "Navigate there"
The link generated is:
tomtomhome:geo:action=show&lat=26.123456&long=28.123456&name=linkname

A link to my iPhone apps that works correctly?

I'm trying to put a button in my iPhone app that will move the user to the appStore and list ALL of our apps.
This wastes time loading safari... then the music store... then the appStore:
itunes.com/apps/OurCompanyName
This tries to load Music Store... and never reaches the app store at all:
itunes.apple.com/us/artist/OurCompanyName/id27628833
This link shows many other company's apps along with ours:
ax.search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&submit=media&term=OurCompanyName
Apple's own "link maker", even with the correct "id#" doesn't work.
The link we cut/paste directly from our "more apps by this developer" in iTunes doesn't get
directly back to that app-list.
Isn't there a simple "direct to the appStore link" that will list all the apps by ONE company?
We do NOT want a clickable link for a browser on a PC. We need a link from a UIButton inside our app.
Well Its doable. Use the UIButton as a way to link to safari and give the url of the code that launches a page or search.
This for example works
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: #"http://ax.search.itunes.apple.com/WebObjects/MZSearch.woa/wa/search?media=software&submit=media&term=Playdom"]];
What about developing one html page with all your apps or make it inside the app and use that.
Try refining your search or inside of your descriptions put something pretty unique in all of your apps
Say developed by CompanyiPhoneDev or whatever and search for that!
also I think there is a way to link to an iphone app store search
Tada!
Hope that helps!
Does the link on AppStore work for you?
For example, the Apple Bumper app is at: http://itunes.apple.com/hk/app/iphone-4-case-program/id383941000?mt=8
When viewing the app in iTunes, right-click on the "Apple Inc." text will give you an option to copy a link, which is: http://itunes.apple.com/hk/artist/apple-inc/id284417353
Another way : http://arstechnica.com/apple/news/2008/12/linking-to-the-stars-hacking-itunes-to-solicit-reviews.ars
has a lot of info like
Searching iTunes relies on the Search
web object application or "woa". This
is located at
http://phobos.apple.com/WebObjects/MZSearch.woa.
You can access this service via your
web browser and it will redirect to
iTunes, which will handle the request.
Here's what a typical search request
looks like: view plainprint?
http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&media=software&term=ad+hoc+helper
http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&media=software&term=ad+hoc+helper
If you paste this URL into Safari,
iTunes launches and displays the
search results for the phrase "ad hoc
helper."
You can perform the same search
directly from the iPhone. The
following code snippet shows you how
to escape the URL and use the
UIApplication openURL: method to
switch control from your application
to App Store, opening its search
window with the phrase you pass. I
have put the search phrase into a
separate string here so you can easily
generalize this operation.
(void) doSearch
{
NSString *search = #"ad hoc helper";
NSString *sstring = [NSString stringWithFormat:#"http://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&term=%#&media=software",
[search
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL: [NSURL
URLWithString:sstring]];
}
the solution is very simple it works like this:
NSString *iTunesLink = #" itms-apps://itunes.com/apps/CompanyName/id123456789";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]];

Send user to Safari and perform a search with their configured search provider on iPhone?

I would like to be able to send the user out of my app and into Safari as if they had performed a search of some terms I provide. I realize I could construct a URL for doing a Google search and send them there, however the user has the option of configuring one of several search engines, and I'd like to use the one they've chosen and not Google.
Is there a way to do this?
I'm pretty sure this isn't possible.
On the iPhone you launch other applications by using a custom URL scheme. A good list of these can be found here: http://wiki.akosma.com/IPhone_URL_Schemes
So for example to launch Safari:
NSString *stringURL = #"http://my.url.com/";
NSURL *url = [NSURL URLWithString:stringURL];
[[UIApplication sharedApplication] openURL:url];
The iPhone then decides to launch Safari as the URL scheme used is http. As you said in your question you can just use the correct URL to launch a search engine, so for Google:
http://www.google.com/search?q=MY_SEARCH_TERM
What would be ideal would be if Apple provided a URL scheme, such as search:// which launched the query in a search engine. However, this sadly isn't implemented.
I think the best way to "solve" your problem would be to allow the user to choose which search engine they'd like to use in your app. Then, when launching Safari you can use the appropriate URL. The added bonus is that you can also include search engines which Apple doesn't.