Discussion Forums  >  WebViews and HTML for Mobile

Replies: 5    Views: 176

AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
10/31/13 07:54 AM (10 years ago)

mailto not working properly

I am building an ios app and trying use mailto in a link on an html page, so that when it is clicked, it launches the email app on the device. If I launch the code directly on a browser, it works as I'd hope. But, if I embed it in a custom html plugin, the email app is fired up, but the parameters don't get passed. The code I'm using is <a title="The Apple way" href="mailto:[email protected][email protected]&subject=Greetings&body= Wish%20you%20were%20here!">The Apple Way</a> AS I say, it works directly from a browser, on a PC, but not from within a plugin. Any ideas anyone please?
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
10/31/13 10:54 AM (10 years ago)
Hi Alan, Haven't tried this myself but I think you can find your answer here: http://www.buzztouch.com/forum/thread.php?tid=46D9126E08CE3CDFF496B15&status=&searchInput=mail&sortColumn=FT.lastPostUTC&sortUpDown=DESC&currentPage=1&doViews=1 Hope it helps. Best Regards, Danny
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
10/31/13 10:59 AM (10 years ago)
Thanks Danny, I saw this, but as it was two years ago, I skipped past it. On closer inspection, even though it is for 1.4, it looks relevant. Coding is not my strong point but I will give it a go. Cheers, Alan
 
PSMDanny
Apple Fan
Profile
Posts: 1166
Reg: Dec 09, 2011
Heerlen
21,940
like
10/31/13 11:01 AM (10 years ago)
Hi Alan, Okay. Let me know if you need any help. But I think the David's post in that thread should be obvious. Best Regards, Danny
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
11/01/13 06:27 AM (10 years ago)
Hi Danny, I just had a look, it does seem to be describing the same problem, but it seems things have moved on in BT from the days of 1.4. I am a bit out of my depth here, so far I see this as a three step process: 1) Find the right file to edit 2) Comment out some code 3) cut and paste some new code For step 1, the file name to edit was CustomURLViewController.m file inside the ScreenControllers folder in Xcode, which no longer exists. I think that the file to edit now may now be BT_viewControllerManager.m in the BT_Layout directory. 2) I don't know if there is anything still to comment out, but originally the lines to remove were : mailer setToRecipients:[NSArray arrayWithObject:request.URL.resourceSpecifier]]; mailer setMessageBody:@ isHTML:NO]; There isn't anything called mailer any more. 3) Then there is some code to cut and paste in. Not sure where this goes and if the original stuff is still valid.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
11/04/13 07:47 AM (10 years ago)
Looks like the function to modify is //send email with toAddress (triggered when link with "mailto" is clicked in a web-view) +(void)sendEmailFromWebLink:(BT_item *)theScreenData toAddress:(NSString *)toAddress{ [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"sendEmailFromWebView: %@", toAddress]]; It looks to me as if this is set up to only be able to pass a 'to' address, not sure why, or how to modify it though.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.