iphone - How to open mail within the app from webview? -
iphone - How to open mail within the app from webview? -
this code..
if ([ [ requesturl scheme ] isequaltostring: @"mailto" ]) { mfmailcomposeviewcontroller *composer = [[mfmailcomposeviewcontroller alloc] init]; [composer setmailcomposedelegate:self]; if ([mfmailcomposeviewcontroller cansendmail]) { nsstring *stremail = [nsstring stringwithformat:@"%@",requesturl]; nsstring *substring = [[stremail componentsseparatedbystring:@":"] lastobject]; [composer settorecipients:[nsarray arraywithobjects:substring, nil]]; [composer setsubject:@"kreativ-q"]; [composer setmessagebody:@"" ishtml:yes]; [composer setmodaltransitionstyle:uimodaltransitionstylecrossdissolve]; [self presentmodalviewcontroller:composer animated:yes]; [composer release]; } }
but when click on link in webview opening in mailbox. , when send or cancel mail service there , go app mail service still there. show me twice. want, open in app only..
thanks in advance.
may help you:
set delegate in .h file if didnt.
<mfmailcomposeviewcontrollerdelegate>
iphone objective-c email ios6
Comments
Post a Comment