How to use [[UIApplication sharedApplication] openURL:] to open another application?

I followed the instructions http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html to open app1 (GlassButton) in app2 (FontTest).

Public FontTest Method:

-(void)open {

  BOOL res = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"glassbutton://"]];

  if (res) {

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"glassbutton://"]];

  }

}

The value of "res" is equal to "YES", but nothing happens after the openURL method is called. The FontTest information list is as follows:

URL Schemes: glassbutton

URL identifier: com.yourcompany.glassbutton

facebook "twitter://" "fb://". , . , - - ? - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url FontTest, , ? ? !

+3
1

, :

NSString *urlString= @"glassbutton://com.yourcompany.glassbutton";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]];

glassbutton :

 - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {

    //your app specific code here for handling the launch

    return YES;
 }

, , , :

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

, .

+3

All Articles