- Home /
Open file with email into iOS 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?
@$$anonymous$$ichaelTaylor3d have you figgured a way to do this?
Answer by MichaelTaylor3d · Jan 08, 2014 at 03:24 PM
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
}
Answer by badescuga9 · Jan 08, 2014 at 03:32 PM
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.
See my edit, I forgot that there was one more step
Your answer
Follow this Question
Related Questions
Can't send email from ios device when email body contains arabic characters! 2 Answers
How to send email using smtp to IOS? 2 Answers
Error sending Email form the game, using SMTPClient Class 2 Answers
social network & share function 4 Answers
How do I send an email on IOS using Application.OpenURL with more than one line of body text? 4 Answers