Hi, use a hidden UIWebView and navigate to the number using tel:... If you use webview, you will be redirected back to your app, after the call has ended.. But webview aks if you really want to dial the number..
Regards, Benedikt -----Ursprüngliche Nachricht----- Von: [email protected] [mailto:[email protected]] Im Auftrag von nader Gesendet: Montag, 13. Februar 2012 17:33 An: [email protected] Betreff: [MonoTouch] Is it possible to go back automatically into the application after calling a Number? In my application I have some phone numbers, so that the users can call the numbers. When the users tap the numbers it push them out of the application to call the number they tapped. What I want is that the application should get the users back to the application after that the conversation is finished. In Mailing mode you can use MFMailComposeController, and then switch back to the previous view. So When you use the *MFMailComposeController* You never get out of the application. MFMailComposeViewController _mail; void HandleMailFinished (object sender, MFComposeResultEventArgs e) { if (e.Result == MFMailComposeResult.Sent) { UIAlertView alert = new UIAlertView ("Mail Alert", "Mail Sent", null, "Yippie", null); alert.Show (); // you should handle other values that could be returned // in e.Result and also in e.Error } e.Controller.DismissModalViewControllerAnimated (true); } public override void ViewDidLoad () { base.ViewDidLoad (); /// Sending mail within the application/ btnEmailInApp.TouchUpInside += (o, e) => { NSUrl emailUrl = new NSUrl("mailto:[email protected]"); if (UIApplication.SharedApplication.CanOpenUrl (emailUrl)) { _mail = new MFMailComposeViewController (); _mail.SetMessageBody ("This is the body of the email", false); _mail.Finished += HandleMailFinished; this.PresentModalViewController (_mail, true); } else { // handle not being able to send mail } }; //Call A number/ this.buttonCall.TouchUpInside += delegate { NSUrl url = new NSUrl ("tel:0707878039"); if (UIApplication.SharedApplication.CanOpenUrl (url)) { UIApplication.SharedApplication.OpenUrl (url); } else { Console.WriteLine ("Cannot open url: {0}",url.AbsoluteString); } } *So is there a way of doing it?* Thanks in advance -- View this message in context: http://monotouch.2284126.n4.nabble.com/Is-it-possible-to-go-back-automatical ly-into-the-application-after-calling-a-Number-tp4384341p4384341.html Sent from the MonoTouch mailing list archive at Nabble.com. _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch _______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
