Open a pdf file from the Resources folder on iOS

After successfully asking for help, on Android I am able to open a pdf file. Note the pdf file must have a .bytes extension.

string fileName = "fileName";
TextAsset pdfTemp = Resources.Load (fileName, typeof(TextAsset)) as TextAsset;
System.IO.File.WriteAllBytes(Application.persistentDataPath + "/" + fileName+ ".pdf", pdfTemp.bytes);
Application.OpenURL(Application.persistentDataPath + "/" + fileName + ".pdf");

However, this does not work on iOS. Anyone know how this could be done?


try reading Unity - Scripting API: Application.dataPath. It may fix your problem.