Okay this has been haunting me for a couple of days, I have this project one of its features is that it would have this button that would open a local pdf file for the user. However, the project is intended for Android and iOS.
What I achieved so far is locating the pdf file from the .apk on android (I haven’t tested it on iOS yet). I used the WWW class to do so, and I checked for the size and it returned the true size of the PDF (Which proves that I have the correct file).
The problem is that I can only access the file through the WWW class (to get the size for example), How do I open it through www.assetBundle.mainAsset?
My thoughts were that I should first save the pdf file in a temporary location and use the OpenURL or maybe the process.start to open it. But I can’t figure out how to do that either.
I have done tones of research and got this far and I can’t find anything online that would help me to take this last step, so if anyone can help me with it, please tell me.
Thanks
EDIT:
The code I used is
IEnumerator Start() {
if(Application.platform == RuntimePlatform.Android){
path =Application.streamingAssetsPath + "/The_100.pdf";
}else{
path = "file://"+Application.streamingAssetsPath + "/The_100.pdf";
}
WWW www = new WWW(path);
yield return www;
}
when I use www.size it returns the correct size of the pdf file