2

I want to save email attachments to my app’s doc folder (C++ FMX app for iOS & Android). How do I register my app as a target?

The screen shots below show that an app on my phone named Termius is a target to save files to. I want my app to be a target like this. Just need user to get files into my app folder.

popup to save doc

target to save to relayman

relayman357
  • 793
  • 1
  • 6
  • 30
  • 1
    Have you checked out this tutorial? https://www.appcoda.com/files-app-integration/ – Sherlock70 May 08 '19 at 09:42
  • Thanks Sherlock70, but i can't see how do what the tutorial shows in Rad Studio. The `UIFileSharingEnabled` keys are not available under "Project->Options->Application->Version Info" and i can't see how to add them. I have no idea how to implement this in C++ Builder. This guys lays it out sweet for Swift though. – relayman357 May 08 '19 at 14:44
  • 1
    Well, now you know the basic method. What you need is a new or refined question of how to get the Swift solution into Delphi. And FYI you can enter your own keys into the Version Info ;-) – Sherlock70 May 09 '19 at 08:27

1 Answers1

3

Based on Sherlock70 tutoring i was able to easily add my app's Documents folder as a "save to files" target. I selected iOSDevice64 as my target platform and then went to "Project->Options->Application->Version Info" where i right-clicked and selected "Add Key" and added the UIFileSharingEnabled key and LSSupportsOpeningDocumentsInPlace key with their values set to true.

snip showing the new keys

Now i can save an email attachment to my app's Document folder via "Save to Files". This link shows how you can then list the files in your Documents folder. Below is image showing what pops up when you click "Save to Files":

enter image description here

Note i'm working in Rad Studio 10.3 (C++Builder 10.3 Version 26.0.32429.4364).

UPDATE: At iOS 13 Apple has moved the "Save to Files" icon.

enter image description here

And here it is:

enter image description here

relayman357
  • 793
  • 1
  • 6
  • 30
  • The above works fine except for Release builds that you need to upload with the Application Loader. The problem on a Release build is that the app store will reject the `UIFileSharingEnabled` key because it isn't formed correctly in the `Info.plist` file. See [the answer here](https://stackoverflow.com/questions/57932283/uifilesharingenabled-key-in-info-plist/57936177#57936177) to see how to easily work around this problem. – relayman357 Sep 14 '19 at 13:58