Make a file type launch your app, and get Path of file

I am creating an iOS app, which handles .CSV files.

Which info.plist property do I need to add to mark CSV files as supported by my app? (So upon touching CSV files my app would launch)

Also, I need the path for the CSV file that launches my app.

I am using the OnAppliationFocus() method, but how do I get the path of the file that launched my app?

CFBundleDocumentTypes. I would google “CFBundleDocumentTypes sample” because there is a bit more involved.

Are you familiar with Objective-C programming? This may be required to do this, because you need to implement this method in your app delegate:
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622921-application?language=obj
I would do that in combination with the following method:
https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623112-application?language=objc
You need to read from the launchOptions dictionary, and then pass that value back to Unity via UnitySendMessage.

1 Like

Thanks for the reply, the CFBundleDocumentTypes example will help most certainly. But I am not familiar with NSDictionary and how I can communicate with my C# code

I have found this:

NSString * aString = [[NSString alloc] initWithString: @"a string"];
UnitySendMessage("MyObject", "Method", [aString UTF8String]);

Should I create an .m file from this? Unfortunately I am really not sure about how this works.