In my app I have a dynamically displayed table using datatables and have the 'csv' and 'excel' buttons enabled. On the ios simulator the Excel file opens, but there are no options to save it etc. Is it possible to download the file to the device? When I use the datatables buttons through a typical website the file gets downloaded automatically in the browser.
Sorry, I'm new to phonegap etc., so my apologies if this is a stupid question.
Thanks for any advice you can provide.
By using a plugin: cordova-plugin-file you can save to the documents directory "cordova.file.documentsDirectory". By default this directory is shared with iCloud, so a file saved here could be opened through the ios File folder and a user could then select the files and hit the share icon to open with the appropriate app, such as Numbers etc.
In order to turn on iCloud you have to pay the developer fee to Apple and select the options to do so. I found the article "Working with the Files App in iOS 11" to be helpful in starting this process.
I had issues saving the Excel file to the device using datatables-buttons, but I was able to do so as a .csv file by updating datatables.js.
In your platform datatables.js file:
Hopefully this will be helpful to someone, as a new hobbyist developer it took me a long time to put these clues together. I wish I could have saved it in Excel format, but I couldn't find any way to update _jszip to save anywhere other than in the browser.