iOS Question Mail composer does not work

olivere

Member
Licensed User
Longtime User
Regrettably the mail composer does not work here: I'm using an iPad (iOS 14.4.2 7) and the mail app is installed and configured.
But the composer window is not shown from my code below, mailc_complete is never invoked.

Is there need for any #plist entries ?

B4X:
mailc.Initialize("mailc")
Log ("Can send:"&mailc.CanSendMail) ' Shows true
Log("Initialized:"&mailc.IsInitialized) ' Shows true
Dim body As String ="Test"
mailc.SetToRecipients(Array("test@test.de"))
mailc.SetSubject("Test")
mailc.SetBody(body, False) 'Text
mailc.Show(B4XPages.GetNativeParent(Me))


Sub mailc_Complete (Result As Int)
    If Result = mailc.RESULT_SENT Then
        Log("ok")
    End If
End Sub


TX, Oliver
 

olivere

Member
Licensed User
Longtime User
Thank you, the sample worked - but I found the reason now:
You need to pass the parent of the current page, not of "me"

This works now:
B4X:
mailc.Show(B4XPages.getnativeparent(B4XPages.GetPage("PageWait")))
 
Upvote 0
Top