iOS Share PDF from Adobe Reader - ios

I'm newer to iOS development and I find the file system to be difficult to work with. I've got many cases implemented in my app to share pdfs from browsers and the files app, but when i try to share a pdf from adobe the shared url to the resource looks like:
file:///private/var/mobile/Containers/Data/Application/EB6B8570-6422-49D8-BCBD-C68B9CBCF3C9/tmp/BBTempFileManager/sharedcopies/C2FB25ED-1414-49F0-8953-FFF3A4F6C76C/Sky.pdf
I have a shared container set up that I can already successfully read and write to during other scenarios. Any ideas why the system believes the file does not exist in this location? It appears maybe I just don't have access? What entitlements/permissions should be set up to explicitly allow for this?

Related

Working with custom user files

I'm currently studying swift and came up with such a question:
What are best practices to work with custom user files like .pdf, .doc?
For instance, I have application, that loads different files from server like .pdf, .ppt, .zip and so on, how to present them inside my app?
While googling I came up with solutions mainly for images, but nothing particular for other file types.
For now, what I have is - downloading files from server using Alamofire and saving them to documents directory.
Could anyone please recommend how to present this files inside my app after I saved them?
Possible solution that comes to my mind is web view, but what about zip? Is there some kind of universal solution? I know that there is Files App in iOS 11, but what about iOS 10?
Many thanks for your attention!

WKWebView File System Browser

I've been asked to add a file browser to an existing Objective C application that uses a WKWebView to load up a Javascript internal app.
Currently we have the capability of looking at the pictures on device to upload images into the app, but I've now been asked to do the same with more generic file types, specifically PDFs.
What I've read so far is that this is only possible if a file is stored in a specific part of the file system and only if the app knows exactly where the file is to begin with, but what I need is the capability to browse to a certain degree.
What I'd like to know is whether this is possible and if there is a good place to start on that?
Thanks.

UIDocumentPickerViewController Limitations, Multiple Files selection at once

In order to be able to access iCloud Drive from the application,
I think that we want to use UIDocumentPickerViewController from the application.
but i found following problems when i use UIDocumentPickerViewController.
Cannot upload multiple files at once.
Cannot Download multiple files at once.
When pushViewController from navigationController then display
become strange.
I want to avoid above problems, So is there any another way to get files information from iCloudDrive without using UIDocumentPickerViewController?
like Send some request or query.
I have searched lot and didn't find any query or request to get Files ,Upload files and download files from iCloudDrive.
if you have any idea about this please tell me.
Thanks,
I don't think there's any straightforward alternative, but you could think of...
...using iCloud directly (not iCloud Drive), but then users will only have access to their files from your application
...using Google Drive's sharing extension which supports uploading multiple files at once (the Dropbox SDK probably supports that, too, but their sharing extension doesn't)
...zipping all files before uploading them
...changing the file format so that it's a bundle of multiple files, if you are in control of the file format
...file a radar/feature request, and possibly wait forever ;)
Not sure if that helps, but I don't think you have much of a choice here.

iOS list document from directory download?

I want to allow users of my app to send PDF which is in the device.
The problem is, I don't see how to do that...
First, where are the files downloaded ? In which directory ? And how to list these files ?
I see there is NSfileManager but I don't understand how to use that.
I want something like DocumentPicker. (but available for iOS 7)
There is no common central directory in iOS that stores PDF files in way you describe. Nothing.
Each app has its own Documents folder, and apps have absolutely no way to see each others docs folder. So you, as a new pdf manager custom written app will not be able to look into other apps docs folder.
NSFileManager is a standard Cocoa class the handles files in a generic manner.

iOS local file access and webkit

I'm absolutely new to iOS App development (I haven't actually started yet, still in a design phase).
The task that I have to accomplish with my app is to download a zip from somewhere, extract anywere to local storage and display its content (html pages with javascript) in a embed webkit widget.
The questions are:
1) Will my app have access to any folder of my iPad storage memory?
2) Will my app's embedded Webkit widget be able to display local html pages (like file:///somewhere/over/the/rainbow.html ?
3) WIll that local page be able to use Ajax method (over httpxmlrequest) to dynamically load external scripts or xml (also locally stored - ie ./something.xml)?
Thank in advance for any help!
No it can't access any file. Apps are sandboxed on iOS. You can only access the app bundle's content and documents folder (a writable area unique to your app).
Yes - provided said content is in the areas mentioned in (1). This is how Phonegap-based apps work.
Yes - they can. We've done exactly this extensively in several of our apps.

Resources