Iphone - How to Read book file from device - iphone

I imported pdf file to iphone device using iTunes. I verified that the pdf file stored in 'root/user/media/books' path. Can i read this file in my program?
Is there any way to read the file? Please Help me.
Thanks in advance.

The SDK doesn’t provide any access to the books (including PDFs) in the user’s media library. For your app to read a PDF that was added via iTunes, it needs to be added to your app specifically, using the iTunes file sharing malarkey (look up “UIFileSharingEnabled” for more information on that). You can file an enhancement request with Apple to try to get them to add support for accessing the user’s book library, but don’t count on it.

Here is a guide on how to view a pdf on the screen. Here is a previous post about how to parse a pdf using CGPDFScanner. Hope that helps!

Related

Importing PDF files to app

I am trying to import a PDF file from other applications, such as mail, but I'm not sure exactly what I should be looking for. I want my user to be able to tap on the share button in a PDF and my app to be listed there as a place that can accept them, such as "Copy to iBooks"
Any good tutorials? Or suggestions as to what I should look for?
Preferably in Swift
Thanks!
You may use Action Extension for making PDF available in your app
Below i have linked Some Tutorials for Action Extension which is not perfect for your requirement but you check the concept and basic implementation for it
Bookmark from Browser
Read a text
Official apple doc
You can tell your app which types of documents it will support in the info.plist. A good place to start is Registering the File Types Your App Supports
in the iOS documentation.

Force download mp3 for mobile site on iPhone

I'm working on a little mobile site for a musician and they want to be able to let users download a song for free on their mobile device. The problem I'm running into is that in Safari for iPhone the song plays in the browser no matter what and does not get added to the music library.
On Android I've been able to force a download which the user can then add to their music application of choice. I was hoping there was some way to get the song into the iPhone music library with out requiring some additional application or going through iTunes.
Any help would be greatly appreciated. Thanks!
It is not possible to have Mobile Safari download a media file from your site to a device's library. That and many other parts of the iOS filesystem are protected from external access.
Safari on iOS 13 and up finally supports file downloads, just like Android and Chrome.
According to a senior level Apple Support Rep, Apple has coded their OS to specifically prevent any audio file that does not have DRM protection, to be downloaded. This means Apple products will force a file to stream as opposed to downloading the entire file. Finding an official statement from Apple is difficult so the closest I could get was talking to a senior rep. You can, of course, call apple for free support with ANY apple product (including I-tunes on windows lol) by calling 1-800 My Apple. Most likely you can get additional confirmation there.
I actually created a site where if you click on a link with a windows or android device, it forces the download. This doesn't work on Apple devices, it still will only stream. The only real fix for this is to offer the file as a compressed file. (ie. zip) then they could download the compressed file but then they would have to open the .zip up and extract the audio.
Ironically, I'm currently looking into how I can use PHP to "zip" a file up on the server side per client request and then deliver them the file in the compressed format. I stumbled across this post because I was attempting to see if there was a way to fool a system into believing a file was in fact protected when it was not.
Hope this helps.

iBooks able to read Files in Other App's SandBox

I want to know if i can develop an app that would download books in epub format from a website and then it would be accessed by iBooks ( iPad app for Reading books ) to read that file.
The issue in my view is that an application can access files present in its own SandBox and it is not allowed to access any file outside it. Please explain if there is any way that files can be downloaded to a specific location on iPad which would be accessible by other apps.
Thanks!
Taimur
No, apps generally cannot access files outside their sandbox (except Apple's own apps, of course, but it is very unlikely they would interfere in another app's sandbox).
However, that is why Apple introduced UIDocumentInteractionController.
Thanks Everyone i have found the answer!
http://andycodes.tumblr.com/tagged/uidocumentinteractioncontroller

How to upload a file from the front end (view) in an iphone app?

In my iphone app, It is a requirement that I enable the user to upload the database file (.sql) from the front end of the app or through iTunes and the app should display the data based on the file he/she uploaded.
How should I go ahead with implementation?
Please give your suggestions.
Please Help.
Thanks!!
You can use NSURLConnection to FTP or HTTP POST the file. There is some server side programming required of course.
There are some answers in stackoverflow explaining the iphone upload like this:
How can I upload a photo to a server with the iPhone?

How to add a file (text or image) to iphone app through itunes?

Is there any way to add a file (image or text) to already install app in the iphone through itunes (or any other way)?
I'm working on an app, in which I want to add a feature for adding external file (like text or image file).
Please help me, how can I achieve this?
Or it is not possible in current SDK?
Note : I don't want to do this through downloading from internet.
Thanks
Maybe I am misunderstanding but if the app is already on the App Store you could just rebuild it with the file and update the binary.
Otherwise it is possible to register a custom URL scheme and pass data through a URL (encode in base 64 for more bang for your buck). There is a game called Moonlight Mahjong that does this to download new mahjong layouts that are then saved onto the device.