ios using itunes to upload an image to app - ios

how can I have itunes uploading an image to the directory of my app on iOS
like user selects an png from her computer and upload that image to the file system sandbox of the app
thanks!

The feature you're looking for is called 'iTunes File Sharing'. With some googling you will be able to find plenty of tutorials about this, such as: http://www.raywenderlich.com/1948/how-integrate-itunes-file-sharing-with-your-ios-app

Related

How detect changes in the application documents directory in iOS app?

I am currently working on an app with the file sharing feature.
We have a view to ask the user to plug his device to iTunes to add files if there is no files in the app.
I would like to remove this view when the iOS app is launched on the device and when the user add at least one file with iTunes to the app.
Is there a way to do that with the default FileManager ? Like a delegate or something to detect events from the document directory of the app ?
I have looked on the web and found some pods but only for macOS.
I have also tried something with a Timer which will get the files from the document directory of the app each 0.25 seconds, but I don't think this is the best way to do what I want.
Thanks for your help.
EDIT:
Thanks to the MartinR's comment below, the following link helps me to do what I wanted
Notification if user modifies contents of documents directory via iTunes File sharing

Getting images in WatchKit app from iOS app

I'd like to show in a WatchKit app the user's avatar image from its paired iOS app. Such image is downloaded by the iOS app querying a REST web service when the user logs in the app. How could I get it from the WatchKit app?
The downloaded avatar is persisted as a .jpeg file in the Documents folder of the iOS app.
The easiest way to solve your issue is to write the avatar image out to the App Group directory instead of the Documents directory in the iOS app. Then you can load the avatar image from the App Group file system directly from the Watch Extension. In order to do this, you'll need to make the following changes.
Step by Step
Add an App Group to your iOS app and Watch Extension
Write the avatar image to the App Group instead of the Documents directory
Read the avatar image out of the App Group in the Watch Extension
Push the avatar image into the WKInterfaceDevice shared image cache
Apply the image to either a WKInterfaceImage or WKInterfaceGroup to be displayed
Hopefully that helps make things a bit more clear.

Cocoa iTunes API in order to download a file on iPad/iPhone

I have a big problem with iTunes. I just want to put a pdf in ebook reader or fetch a pdf (mac to iPhone/iPad and iPhone/iPad to mac).
I want to write a very small and simple program that allows to read iPad content like a usb key.
Is there some iTunes API or Cocoa API to do this ?
Thanks
Already answered in How to enable file sharing for my app?: Open the info.plist of your application and add the following key: Application supports iTunes file sharing and set it's value to true.
For more details see the Ray Wenderlich Tutorial on iTunes Tutorial for iOS: How To Integrate iTunes File Sharing With Your iOS App

iOS Mobile Safari File Upload renames file

I have a web app designed for use on an iOS device. The web app includes file uploaders, which are meant to allow the user to upload an image from their iOS device or take an image from their camera.
The issue I'm running into is that I want the user to be able to upload PNG images through this interface, as well.
What is happening, though, is that it seems iOS renames the file image.jpg before it is sent to the web app, not honoring the original file extension. This is only an issue because I am trying to preserve transparency in the .png files, and this is lost in the extension renaming.
Any thoughts on how to handle this? Thanks, in advance, for any assistance on this front.
Mobile Safari only allows the uploads of jpeg's at this time. If you try to upload a png it will be (heavily) compressed into the jpeg format and then uploaded to the server.
The only way we have been about to get around this is by creating a native app for iOS and uploading the image through the Cocoa-Touch API's.
I've filed a Bug report with apple for this issue. Bug ID: 14494395

Path of photos folder in ipad

I am trying to make a ipad app which would upload the latest synced photos on an ipad to a web server.
I found a great reference for how to upload a file by http here.
How can I upload a photo to a server with the iPhone?
However what should be the path to the photos folder?
It would be great if somebody can suggest an example for
Listing all directory in the photos application.
How to enumerate a file in a directory/album and get its path.
I am really new to iOS devleopment. Sorry if i am bit vague.
Appears to be in /var/mobile/Media/DCIM/ .
Reference: http://www.macstories.net/ipad/ipad-photos-documents-finder-mac/
Refer - How can I load images from a user's photo album on the iPhone?

Resources