Tuesday 8 October 2013

Open other apps from iOS app using URL scheme. Open google maps, mail from the app, call a number, send sms using Xcode.


Use openURL: function of UIApplication.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];

Open The Google Maps:

// Create string for the place ...
NSString* placeStr = @"1 Infinite Loop, Cupertino, CA 95014";
// Encode URL encode
placeStr =  [addressText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// Now create the URL string ...
NSString* urlString = [NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", placeStr];
// use openURL to launch the app ...
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];

Mail from the app:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://info@example.com"]];

Call a number:

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

Send SMS:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms:55555"]];

Open App Store:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"https://itunes.apple.com/en/app/apple-store/id375380948?mt=8"]];

2 comments:



  1. Thank you for your post. This is excellent information. It is amazing and wonderful to visit your blog.
    ios app development course
    iPhone training institute in bangalore

    ReplyDelete
  2. If you want to become a professional IOS developer. you should learn IOS. By learning IOS you can able to create build views. You can handle user interaction via controls like buttons, switches, and sliders etc. We can also able to display data in a table view. You can create alert boxes, handle navigation and transition between views. You can also follow iOS Online Training Bangalore

    ReplyDelete