7

I want to make a Document Provider extension for an app originally developed in IONIC.
I understand that I can use .xcodeproj file to open the project in XCode and then add new target for intended extension.
However, I'm confused about shared storage between my AppGroup (App & Extension).
According to NSFileManager (now FileManager), you need to store files in a shared container with group identifier.
The method to achieve this is following:-

func containerURL(forSecurityApplicationGroupIdentifier groupIdentifier: String) -> URL?

However according to IONIC guide the files can be saved in one of these locations:- enter image description here

According to IONIC Developer, the files currently reside in Document Directory of App where we need to have those files in a shared container as mentioned above.

How can we achieve that?

FYI: I couldn't find any help on IONIC forums regarding this, and I'm following this tutorial for Extension development.

boraseoksoon
  • 2,164
  • 1
  • 20
  • 25
Abid Hussain
  • 1,529
  • 1
  • 15
  • 33
  • Do you want to ship some files with the app or you want the files to be downloaded dynamically after the app install? – nishith Singh Oct 19 '16 at 12:23
  • No, app creates some files like notes etc. I want those files to be available to other applications of same App Group. An analogy can be dropbox or iCloud drive. – Abid Hussain Oct 20 '16 at 06:53
  • Hey @AbidHussain: have you managed to solve this? – Nikola Mar 04 '17 at 14:58
  • 1
    @Nikola yeah but solutions is a hack. I used generated project and built extension with it. To copy files in shared container I wrote a class to copy contents of document directory in shared container. The routine runs with a timer and also when a new file is written in doc directory. But issue obviously was that all the code had to be re-written each time this project is regenerated. I'm not IONIC expert so I don't know if it's the case but I guess it'll be this way. let me know if you need more help. – Abid Hussain Mar 08 '17 at 06:43

0 Answers0