-1

On some app , I see when one link touched , use safari for open link and quit from current app. I want use from this feature for run messages app from other app. Can I do this? If yes, how can?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Fa.Shapouri
  • 988
  • 2
  • 12
  • 30

4 Answers4

6

You need to use -[UIApplication openURL:]. For example, you can use

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: @"http://www.stackoverflow.com"]]

Note this will also switch to the new app. An application can register the URL schemes it supports using its plist.

Ben Gottlieb
  • 85,404
  • 22
  • 176
  • 172
0

The only way I know to start external application is to use UIApplication openUrl. The documentation says

An object representing a URL (Universal Resource Locator). UIKit supports the http:, https:, tel:, and mailto: schemes.

If you meant e-mail application, you can pass link according to mailto: scheme. The simplest example is @"mailto:someone@example.com".

SergGr
  • 23,570
  • 2
  • 30
  • 51
0

I do it , I write sms in mailto place and write phone number in front of it. and app work correct,

   [[UIApplication sharedApplication] openURL: [NSURL URLWithString: @"sms:09120000000"]];
Fa.Shapouri
  • 988
  • 2
  • 12
  • 30
0

Yes: you need use URL Schemes:

Essentially, one app registers the fact that it handles a particular URL prefix, and then to launch that app, you have to navigate to that URL.

You can pass parameters through this URL too

If you meant e-mail application, you can pass link according to mailto: scheme. The simplest example is @"mailto:someone@example.com".

Thanks :)

Nikhil Bansal
  • 1,545
  • 13
  • 29