1.Call Telephone PhoneReturn apps in iOS apps when you end your phone call is typically made in the app by dialing:
Nsurl *url = [Nsurl urlwithstring:[nsstring stringwithformat:@ "tel:10086"]];
[[UIApplication sharedapplication] openurl:url];
When you make a call this way, the iphone interface stays on the phone interface when the user ends the call. The user will be automatically returned to the application after the call is completed in the following way: Uiwebview*callwebview =[[uiwebview alloc] init]; Nsurl *telurl =[nsurl urlwithstring:@ "tel:10086"];//looks like tel://or tel: all line [Callwebview loadrequest:[nsurlrequest RequestW Ithurl:telurl]]; Remember to add to view [Self.view addsubview:callwebview];//cannot be missing2. call to bring your own mail[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "Mailto://[email protected]"];
3. Call SMS[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "sms://800888"];4. Call your own browser Safari[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "http://www.hzlzh.com"]; Call phone can pass number, call SMS can only set number, cannot initialize SMS content.If you need to pass content, you can do the following:Join: Messageui.framework #import <MessageUI/MFMessageComposeViewController.h> Implement Proxy: MfmessagecomposeviewcontrollerdelegateCall the Sendsms function
| Content, recipient list-(void) Sendsms: (NSString *) bodyofmessage recipientlist: (Nsarray *) recipients{ Mfmessagecomposeviewcontroller *controller = [[[Mfmessagecomposeviewcontroller alloc] init] autorelease];if ([ Mfmessagecomposeviewcontroller Cansendtext]) {controller.body = bodyofmessage;controller.recipients = Recipients; Controller.messagecomposedelegate = self; [Self Presentmodalviewcontroller:controller Animated:yes];}} Processing the response sent out-(void) Messagecomposeviewcontroller: (Mfmessagecomposeviewcontroller *) Controller Didfinishwithresult :(Messagecomposeresult) result{[self dismissmodalviewcontrolleranimated:yes];if (Result = = messagecomposeresultcancelled) NSLog (@ "Message cancelled") else if (result = = Messagecomposeresultsent) NSLog (@ " Message sent ") Elsenslog (@" Message failed ")} |
The default text messaging interface is in English, the solution is: Add a group of Chinese in. Xib Localization OK
iOS call phone, SMS, etc.