I am using native.showPopup in separate functions for emailing a .jpg image file and a .csv file, but the attachment for a .csv file in iOS11 is not working. See code example below.
On the Windows simulator, the .jpg files and .csv files get created and can see them in the sandbox.
On my Android device. the email window popups up and successfully attaches and emails a .jpg file or .csv file depending on the function.
Now on Mac/iPhone…
On the Mac simulator, the .jpg files and .csv files get created and can see them in the sandbox after executing both functions.
On the iPhone when using the function for the .jpg , the email app pops up and successfully attaches and emails the .jpg file.
On the iPhone when using the function for the .csv, the email app pops up but does NOT attach the .csv file.
Rob, you mention above the popup is longer supported in iOS11. Do you mean not supported for ONLY “social” since it still appears to be working for “mail” and attaching .jpg files (but not .csv files)?
And if it is still supported in iOS11 for “mail”, is anyone else experiencing issues with attaching non-image files in iOS11?
local options =
{
to = “”,
subject = “Standings File”,
body = “See attached standings file.”,
attachment = { baseDir=system.DocumentsDirectory, filename=“standings.csv”, type=“text/csv” }
}
native.showPopup( “mail”, options )
AND
local options =
{
to = “”,
subject = “Standings Pic”,
body = “See attached standings pic.”,
attachment = { baseDir=system.DocumentsDirectory, filename=“standings.jpg”, type=“image/jpeg” }
}
native.showPopup( “mail”, options )
–Updated March 24, 2018
Just a follow-up to the above…I am not exactly sure what the solution was since I tried many things, but I think the thing causing my issue with .csv attachments in iOS11 is that I was not closing the file prior to using native.showPopup. I was previously writing data to a file upon a push of a button and then performing the showPopup right after writing to the file was finished. Then I changed my code to close the file using io.close(file) prior to showPopup, and it then worked. It worked on Android without closing file first, so just must be an iOS matter.