內置的應用程序,我需要從我的應用程序的附件與科羅娜SDK內置在iOS設備上使用10.2.1發送電子郵件。我曾經創建過一個Corona應用程序,它能夠發送帶有附件的電子郵件,並且工作得很好。現在,iOS版10.2.1的,它似乎並沒有工作,如果它是我不能說,因爲我寫的代碼錯誤,或者如果native.showPopup
不與iOS兼容10.2.1。發送帶附件的郵件從科羅納在iOS 9.2.1
我使用電暈建設2017.3059。
另外,我還檢查了我的設備(iPhone的6)native.canShowPopup("mail")
,它表明郵件彈出功能是可用的設備上。
以下是我正在使用的代碼。
local widget = require("widget")
-- Function to handle button event
local function sendMail(event)
if ("ended" == event.phase) then
if (native.canShowPopup("mail")) then
native.showAlert("Alert!", "Mail IS available on this device", { "OK" })
local options =
{
to = { "[email protected]", "[email protected]" },
cc = { "[email protected]", "[email protected]" },
subject = "My High Score",
isBodyHtml = true,
body = "<html><body>I scored over <b>9000</b>!!! Can you do better?</body></html>"
}
native.showPopup("mail", options)
else
native.showAlert("Alert!", "Mail NOT available on this device", { "OK" })
end
end
end
-- Create the widget
local mailButton = widget.newButton(
{
label = "Mail",
fontSize = 64,
onRelease = sendMail, -- this is my function to send mail
labelColor = { default={ 1, 1, 1 } },
labelAlign = "center",
emboss = false,
shape = "roundedRect",
width = 200,
height = 100,
cornerRadius = 13,
fillColor = { default={1,0,0}, over={0,1,1} },
strokeColor = { default={1,1,1}, over={1,1,1} },
strokeWidth = 4
}
)
mailButton.x = display.contentCenterX
mailButton.y = display.contentCenterY