iOS Question Using 'MailTo' In WebView

RichardN

Active Member
Licensed 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:joe.bloggs@gmail.com?subject=Application%20Feedback&cc=another.friend@gmail.com">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

Active Member
Licensed 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("software.company@domain.com"))
    mailc.SetCcRecipients(Array("another.person@gmail.com"))
    
    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