Has anyone figured out how to associate a custom file type with a unity iOS app so that it opens the app and then the app opens that file.
From the email app?
Has anyone figured out how to associate a custom file type with a unity iOS app so that it opens the app and then the app opens that file.
From the email app?
Its all explained here.
Right now I have it working pretty well.
Edit:
one thing that I forgot to add is that I followed these instructions and put the info.plist file in the plugins/ios folder.
I then created a post processor script that automatically sends the plist to the iOS project when you build it.
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
public class BuildPostprocessor {
#if UNITY_IPHONE
private static string sourceFile = Application.dataPath + "/Plugins/iOS/info.plist";
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
System.IO.File.Copy(sourceFile, pathToBuiltProject + "/info.plist", true);
}
#endif
}
yea, but this is native code. I can suggest an alternative way. I just found this out.
If you set the property “Application supports iTunes file sharing” to true in Xcode → Info → Custom iOS Target Properties, you will see that the file you’ve opened with your app is visible in itunes → your_device → Apps → File Sharing in a folder named “Inbox”.
So, what unity3d does, it makes a copy of the file you’ve opened with your app and stores it in your Documents folder for your app under the Inbox folder. Hope this is useful.