Closed limbenjamin closed 8 years ago
On iOS, people usually use HTML5's FileSystem API and get an entry.toURL()
reference and open it from there. Look in other open and closed issues in this repo, There are some examples written by other users.
Thanks, figured that you need an if/else statement and a separate set of code to deal with iOS and android. Not possible to have same code running on both platforms.
$ionicPlatform.ready(function()
{
$scope.openPDF= function($path) {
var path = $path;
if (ionic.Platform.isAndroid()){
}else if(ionic.Platform.isIOS()){
}else{
}
};
});
That's great. Good luck!
I am deploying the same app on both the iOS and android platform. The app requires opening of locally stored PDF files. Since android does not allow the native PDF application to access the private app storage, I used asset2sd to copy the PDF from the asset folder onto the SD card and used cordovaFileOpener2 to open the file on the SD card. This works fine.
My questions is how will this work on iOS given that iOS devices do not have an SD card. Is it possible to have the same code work on both platforms?