swift - iOS export to csv does not work for some messengers -
i have used this tutorial implement export csv feature.
my code:
let menuitemsstat = orderstable.getstatsformenuitems(startdate: startdate, enddate: enddate) if menuitemsstat != nil { let itemsnames = menuitemsstat!.itemnames let itemvalues = menuitemsstat!.itemvalues generalstats.append("\(nslocalizedstring("menu item;quantity of orders", comment: ""))\n") itemname in itemsnames { generalstats.append("\(itemname);\(itemvalues[itemsnames.index(of: itemname)!])\n") } } line in generalstats { csvfile.append(line) } { try csvfile.write(to: path!, atomically: true, encoding: string.encoding.utf8) } catch { print("failed create file") print("\(error)") } let vc = uiactivityviewcontroller(activityitems: [path!], applicationactivities: []) present(vc, animated: true, completion: nil) vc.excludedactivitytypes = [ uiactivitytype.assigntocontact, uiactivitytype.savetocameraroll, uiactivitytype.posttoflickr, uiactivitytype.posttovimeo, uiactivitytype.posttotencentweibo, uiactivitytype.posttotwitter, uiactivitytype.posttofacebook, uiactivitytype.openinibooks, uiactivitytype.message ]
code works no issues. have checked export several applications: mail (default ios client), airmail (3rd party mail client), telegram, file exported properly.
but when i'm trying perform export whatsapp messenger, i'm getting error whatsapp file not supported. okay, whatsapp not support csv. when i'm trying export file vk application (app russian social network), sends link application, this:
file:///private/var/mobile/containers/data/application/aeaf28d0-d75c-443d-87dd-44822ed73793/tmp/icafemanager_stats_25%20%d0%b0%d0%b2%d0%b3.%202017%20%d0%b3.,%200:00-25.08.2017,%2023:13.csv
is caused implementation? or it's third party apps issue?
if cannot solved, how can exclude apps export not in default list (like facebook, vimeo , on)?
wiki
Comments
Post a Comment