0

The Xamarin app writes a file to its 'sandbox' in the MyDocuments directory.
How do I configure the Xamarin app's project to allow another app to read this file; to expose the MyDocuments directory to another app?
How do I configure get the path for the Obj-C app to read the file?

Xamarin app is a .NET Standard 2.0 class lib project in Visual Studio.

BACKGROUND... The Xamarin app receives BLE data and writes it to files in its MyDocuments directory.
The Obj-C app must read these files and process.

The new IOS 11 File App was suggested as an answer, however I don't think the File App has anything to do with my question because I want my Xcode Obj-C app to programmatically read the file that was written by my Xamarin.IOS app.

Xamarin app's code for writing the file..........................

    Sub append_text_file( pathname as string , text_to_file as string)

        dim documents as string = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)

        dim platform_agnostic_pathname as string  = Path.Combine (documents, pathname )
            System.IO.File.AppendAllText( platform_agnostic_pathname, text_to_file)      
End Sub

Another great resource:
App Group Capabilities in Xamarin.iOS at: https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/provisioning/capabilities/app-groups-capabilities ...I USED SAFARI ON MACBOOK. IT DOESN'T WORK WITH CHROME ON WINDOWS.

Doug Null
  • 7,989
  • 15
  • 69
  • 148
  • If both apps are from the same developer (i.e. they use the same group bunder id ( `App Group ID` ) and are signed by the same cert), you can write/read files to their `SharedLocationPath` – SushiHangover Aug 19 '20 at 23:35
  • Thanks. How do I get SharedLocationPath ? – Doug Null Aug 20 '20 at 21:45
  • https://developer.apple.com/documentation/foundation/nsfilemanager/1412643-containerurlforsecurityapplicati (read the **`Discussion`** section) / https://stackoverflow.com/a/27730754/4984832 – SushiHangover Aug 20 '20 at 22:52
  • Thanks, Sushi. You've really kicked me forward. – Doug Null Aug 21 '20 at 01:31

0 Answers0