You can use Openurl to open some programs, not just browsers. We will demonstrate these applications in the following example:
Open a browser
Open Google Map
Open email
Dialer
Text messaging program
Open appstore
Launch Google Maps
The URL format to GoogleMap is:
Http://maps.google.com/maps? Q =$ {QUERY_STRING}
You can change QUERY_STRING to change the location information:
Nsstring * searchquery = @ "The Postion I want to know ";
Searchquery = [searchquery stringbyaddingpercentescapesusingencoding: nsutf8stringencoding];
Nsstring * urlstring = [nsstring stringwithformat: @ "http://maps.google.com/maps? Q = % @ ", searchquery]; [[uiapplication sharedapplication] Openurl: [nsurl urlwithstring: urlstring];
Open Apple Mail
Format:
Mailto: // $ {email_address}
[[Uiapplication
Sharedapplication]
Openurl: [nsurl
Urlwithstring: @ "mailto: // info@iphonedevelopertips.com"];
Call (iPhone only)
Format:
Tel: // $ {phone_number}
1
[[Uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "Tel: // 8004664411"];
Text message
Format
SMS :$ {phonenumber_or_shortcode}
1
[[Uiapplication sharedapplication] Openurl: [nsurl urlwithstring: @ "SMS: 55555"];
Open App Store
Open the appstore program location, right-click the program icon to get the URL
The format is as follows:
Http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware? Id = 291586600 & mt = 8
1 2
Nsurl * appstoreurl = [nsurl urlwithstring: @ "http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware? Id = 291586600 & amp; MT = 8 "]; [[uiapplication sharedapplication] Openurl: appstoreurl];