Hi, I’m trying to send a custom email to the contacts registered in my phone using native.showPopup, but after picking the contact the email popup doesn’t open.
Testing on the Xcode simulator only says that email isn’t supported.
This is my code, can someone help me?
local function inviteContactsEmail( event ) if event.phase=="ended" or event.phase=="cancelled" then local pickContactOptions = { option = "pickContact", hideDetails = true, performDefaultAction = false, filter = { "email" }, listener = onPopupDismiss } native.showPopup( "addressbook", pickContactOptions ) end return true end local function onPopupDismiss( event ) local email="" -- if there is 'event.data', print its key/value pairs if ( event.data ) then for k,v in pairs( event.data ) do if k=="homeEmail" then print( k, ":", v ) email=v end end if email=="" then print("Email doesn't exist") else timer.performWithDelay(1000, sendEmail(email)); --system.openURL( "mailto:"..email.."?subject="..subject.."&body="..body ) end end end local function sendEmail(email) local options = { to = email, subject="Join", body=myApp.userData.username.." Invite you" } native.showPopup("mail", options) end