In my app I have the following code (so the users can send an error og back to me):
local options =
{
to = “allthumbsdev@gmail.com”,
subject = “Karate Squid Log”,
body = “Your comment here”,
attachment = { baseDir=system.DocumentsDirectory, filename=LOG_ZIP_FILE, type=“log/zip” }
}
native.showPopup( “mail”, options )
This has worked great, but after I switched to Solar 2D (which is just now), this doesn´t seem to work anymore. Not in the simulator (Mac) or with an actual device (iPhone). There are no error messages or anything. The code is just ignored.
Has anything changed in this department? The docs are the same, as far as I can tell.
It isn’t working for me either. As @runewinse said, the call is completely ignored both in simulator and on the iPhone. I am using Corona Simulator 2020.3624
I just realised that the file that was supposed to be attached was missing. That’s why the call was ignored (also making the app freeze for a few seconds). If the file is found the mail popup shows as expected.
I really don´t get this. I made a test if the file exists and it fails already in the pathForFile() function, but the file/path seems to be valid (see the log.zip info dialogue).
Sorry about the “File does exist”. It was a typo. Should ofcourse have been “File does NOT exist!”
As for the “log.zip removed” console output, this is from the removal of the old log.zip file.
Here is a modified version. This time Ive listed all the files in the DocumentsDirectory folder right before checking the existence of the log.zip file and surely enough, it´s right there in the list of files.
What does the u.fileExist function do? Are you sure it does what it’s supposed to? Does fileExist work ok for the other files in the directory, e.g. log.txt?
Also, in the showPopup options the type should be “application/zip” and not “log/zip”. You can find here a list of the most common MIME types: https://en.wikipedia.org/wiki/Media_type
Thanks, I found a couple of lines of dubious code…
I used the fileExist() function in a wrong way, since the second parameter defaulted to the ResourceDirectory if nil. I´ve now used it correctly and it reports the file as existing.
But that I already knew, both from checking it in Finder and from the log from the folder listing done right before. The log shows like this:
I run your example project, replacing the LOG_ZIP_FILE with “log.zip” as follows: attachment = { baseDir=system.DocumentsDirectory, filename="log.zip", type="application/zip" }
The native.showPopup worked fine on the iPhone attaching the log.zip file. On simulator it doesn’t work but I don’t think it’s supposed to work on the simulator anyway.
hi, I’m having the same issue as the OP. I had a link in my app that users could tap to email me. Worked fine for years. I am tinkering with the app for the first time in over a year, and noticed that the email link no longer works on my iPad. I have the device connected to my computer so I can watch the console. The call to native.showPopup(mail) returns false on the device. I’m running simulator build 2020.3635 on MacOS 11.1. My iPad is using iPadOS 14.2. Here’s the code in question:
I used the fileExist() function in a wrong way, since the second parameter defaulted to the ResourceDirectory if nil. I´ve now used it correctly and it reports the file as existing.