Problem:


Building Enterprise Programs of the Suite Character, and want to have the ability to pass data in one application to a different. Example: App1 is really a barcode readers that creates and inventory list. App2 requires a "fresh" copy of the identical inventory list information that App1 just created to be able to accomplish its goal of creating purchase orders. The 2 applications and databases are two large to squeeze together in single application, as well as the suite will keep growing with increasingly more applications.


Understanding:


I completely understand that "Each" application is within it's own sandbox. However, in reading through with the documents concerning the new UIDocumentInteractionController API, it seems that the application can dip outdoors from the sandbox somewhat to "Read-In", "View", or "Open-In" a document which was not apart from the bundle or produced inside the application.


Data Flow:


I am attempting to keep it simple; I have used the DocInteraction sample application downloaded from Apple, and the other application...known as App1 to make use of a simple text file. In App1, I produce a simple txt file, and save it towards the documents folder. (But this really is still within the app's sandbox?). within the DocInteraction modified sample, I've been attempting to figure a method to "View", "Open-In", or even better "Read-In" the produced txt file. Basically can pass an easy txt file between your two, I'm able to incorporate a CSV structure to update the databases on both sides whenever the programs are opened up.

I've attempted to make use of the Launch Options Secrets without any luck.

In a nutshell, I simply can't appear to obtain my mind around:

  1. Where App1's data must go?
  2. How to locate the information within the other Application, say App2?
  3. How can you "Open" the file which exist inside another application's sandbox?

Finish Result: I've attempted to step back in the

The Document Interaction paperwork outline:

  • Previewing a Document or Showing Options
  • Signing up Your Support of File Types
  • Opening Files Using Their Company Applications
  • Exhibiting and Printing Glance Previews

It's the "Opening Files Using Their Company Applications" that i'm most interested with. It directs me to make use of the applying:didFinishLaunchingWithOptions: method by passing in dictionary values for that secrets. This is when I recieve lost?? How do you set the secrets to ensure that it knows "WHERE" and "WHAT" to search for? And I am still not obvious the correct director that App1 ought to be saving information to to ensure that the secrets to suggest towards the correct place?


Opening email file accessories and opening ebooks in iBooks can't be the sole places where one can employ this API otherwise Apple wouldn't have experienced everything, they're already let it talk from Application-To-Application.


Note: I am not looking to get App1 to directly transmit data into App2's files. I do not think that might be permitted by Apple whatsoever! I am looking to get App1 to zip up its data, save it in proper location, then when user decides to make use of App2, the information may then be accessible to App2 by "reading through-in" the information.


If a person includes a sample application, tutorial, or perhaps a solid idea ways to get this working I'd really appreciate the assistance.

-Thanks!

P.S. Somebody with 1,500 or greater status please produce a "UIDocumentInteraction" tag for stackoverflow!

I first got it working recently. Here's my mental model:

App1 produces personal files any place in its sandbox.

App1 calls docinteraction to show the "Open In" GUI for your file

User picks "Open in App2"

The iOS copies the file in one sandbox towards the other and launches App2.

App2 implements didfinishlaunchingwithURL and loads the provided URL (the copy in the sandbox)