iOS Question Using 'MailTo' In WebView

RichardN

Well-Known Member
Licensed User
Longtime User
This has been mentioned elsewhere in the past but the iOS support for the standard HTML syntax for 'mailto:' appears to have changed.

When you code.....
HTML:
<a href="mailto:[email protected]?subject=Application%20Feedback&[email protected]">Send us some feedback</a>
On the device, clicking on the link does nothing. However a long-click pops up a dialog that offers the user a Newmail/Send Message/Add to contacts choice.

If you click the New Mail option the mail client pops up with the correct address populated but none of the other Subject or CC parameters that are normally passed to the client.

Anybody had better luck with this?
 

RichardN

Well-Known Member
Licensed User
Longtime User
It looks like Apple have tied-up even tighter any interaction with other applications from web-pages.

The WebView_OverrideUrl method is successful.

B4X:
Private Sub WebViewAbout_OverrideUrl (Url As String) As Boolean                       
    
    'Offer a pre-populated email message from my 'About' page to the user - they still need to press 'Send'
    'Requires iPhone library
    
    'There is only one link in my read-me page so no need to filter or check the link
    'I merely wish to offer a pre-populated mail for feedback
        
    Dim mailc As MailComposer
    mailc.Initialize("")
    mailc.SetToRecipients(Array("[email protected]"))
    mailc.SetCcRecipients(Array("[email protected]"))
    
    mailc.SetSubject("iOS Application Feedback")
    mailc.SetBody("This will be the body of any message",True)
    
    mailc.Show(AboutPage)
    
    Return True            'Consume the event
    
End Sub
 
Upvote 0
Top