tags:

views:

42

answers:

2

i am working on an application in which i needs to call safari when i click on a button..... please tell me how to do this should i create a new view for this ? kindly help.... please also tell about importing messagebox and callmanager if possible..... (not talking about sending msg or call from my app ...know that is not possible... i want to call inbuilt applications only) . also wanto confirm that will my app close when i will call these inbuilt applications....

thanks....

+2  A: 

If you call openURL with a general (for example not a youtube link) web page, then by default it will be opened through safari. However, your app will be terminated.

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

Sorry, can't help about the messagebox.

taskinoor
thanks a lot...
Ranjeet Sajwan
getting a vote is the best thank :-)
taskinoor
sorry i tried... but my reputation is less ....i will surely try it later...thanks again...
Ranjeet Sajwan
here i did it... voting...thanks
Ranjeet Sajwan
+2  A: 
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://9016098909891"]];

You can use the above function to call from the iphone

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

USe this to open safari and so on.. hope yo got the idea what exactly to do....

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

uSe the above to send SMS from iphone

hAPPY cODING....

Suriya
openURL takes a string parameter? 2nd example should also take a NSURL.
taskinoor
dats what i had noted after posting and hence edited it already...Still thanks for showing me ma mistake..
Suriya
thanks but what about...messages...
Ranjeet Sajwan
@ranjeet: are you talking about sms?
Suriya
yes...and also want to know when i reach there will my app close...
Ranjeet Sajwan
i have added the sms part too..KINDLY CHECK. and as your question states that you want to open up the inbuilt stuffs in inbuilt and not in your application so YOUR APPLICATION WILL EXIT whenever you make any of the above calls
Suriya
thanks a lot and i will def. make vote when reach to 15 reputation...
Ranjeet Sajwan
it would my pleasure... n u r always welcome....
Suriya
i voted.........thanks
Online