I am trying to load the images received from a contact in iMessage, but I have not found in iOS SDK to do this.
Load the contents of incoming iMessages.
Load the images received by iMessage.
Someone who knows how to help me?
This can not be done with on iOS with the iOS SDK. Due to privacy concerns Apple does not allow access to any messages received via the messages.app.
If you're looking to pull images directly from the Messages app, then no you can't do that. If however, you're okay with only viewing the images that the user has chosen to save to the camera roll, then yes you have a few options.
You can use the UIImagePickerController class to allow the user to select photos from their camera roll, or the AssetsLibrary Framework to get references to these images without the user selecting them. Both solutions do require the user granting you access to the camera roll though.
Related
After submission for review, I got this from Apple review:
We noticed that your app requests the user’s consent to access the camera and photos, but doesn’t sufficiently explain the use of the camera and photos in the purpose string.
In my app, camera and gallery access is needed in various places like for uploading product images, sending images to chat, posting images in the news feed, and uploading profile photo.
Apple requires an explanation to why the camera and gallery are being accessed.
If I explain the use for uploading profile image, this is irrelevant if they upload a product and also needs another explanation if the user will send photos to chat.
So the question is how can I generalize the camera's purpose string in a way that it can cover all my camera usage given that the purpose string is only one.
Or is there a way to write a camera purpose string for each and every camera usage?
Yes, #john we have to elaborate properly as they show the same message to the user on the permission popup.
I am using the below statement & app is accepted by AppStore
<key>NSCameraUsageDescription</key>
<string>Access to your camera is required to capture photos required for loan processing or your profile.</string>
<key>NSLocationUsageDescription</key>
<string>To show your location on the map.</string>
Hope this will work!
There's no way to have multiple purpose strings because Apple is not allowing you to customize the permission dialog.
You can just put what they are used for in one sentence, like "Need your permission to Photo Gallery for post or chat"
I got the same response the other day. My case is using the photo for feedback or a user avatar. So I just put all of them in that string
Hope this will help.
I am an iPhone user and typically, when you want to upload a photo to an app, there are three steps:first, the app checks whether it has permission to access albums and if it does not ,it will ask you to give permission. Then, you will be presented with an interface from which you can select a photo from the album, and finally, you press a button to upload the selected photo to the app. Previously, I thought the app can only access the photo that the user selects, but then I saw this answer:
https://apple.stackexchange.com/questions/107404/is-it-safe-to-allow-apps-to-access-your-photos
which says: "When you give access to an app to photos...it can read all your photos on the device in an unencrypted form." "For example, once you give permission, iOS apps for popular services like Dropbox, Facebook, Flickr and Google+ can upload all your photos to their services. With iOS 7, these apps can also be allowed to do it in the background (when you're not actively running the app). Most users wouldn't even actively know which photos are being uploaded and when."
Millions of people are using ios system and many photos in the albums are private, including but are not limited to images of having sex, images of getting drunk, etc. so I think the most appropriate design is to let the app only access the photos that users selected, not all the photos on the phone. And I think a lot of users, like me, believe that when you give an app permission to access the album, it can only access the photo selected by users, not every photos on the device.
Since I'm a programmer(but not an ios programmer), I take a look at the ios documentation, and I found a class called UIImagePickerController. I believe it is through this class that the app gets a selected image from the user, so it seems to me that an app can only access the selected image. But on stackoverflow I also found an answer about how to select all photos from the device: IOS Photos framework
So my question is, if you give an app permission to access the album, can it only access the photo users select from UIImagePickerController, or every photo on the device?
Once a user grants permission to access the photo library, that iOS app has complete access to every photo in the user's photo library. The permission is not for a specific photo. And UIImagePickerController is only a graphical means to allow the user to select an image. There are APIs that allow the app to access any photo without user interaction. And all of those APIs are covered by the one single permission to allow access to the photo library.
#rmaddy is correct that the user grants permission to access the entire photo library on the user's device. However, note that iPhone users have the option of hiding photos by viewing the photo and tapping the share button (Tap share and select Hide.) See Apple support article .
The documentation for the Storage Provider extension only refers to documents and files. It's not clear if it works for images and photographs. For instance, could an app create an extension that gets invoked in iMessage when the user taps the camera icon to insert a picture from the Photo Gallery?
It depends on how Apple implements the iMessage photo picker. If they go through the document picker API, you will get a chance to provide images. If the use the photo picker view controllers, however (PhotoUI framework or otherwise), you will not be able to.
Apple is most likely to go through the second route, but if this is an important feature for you, make sure to file a an enhancement request with Apple and post the radar number here so people can duplicate.
As of beta 2, Apple does not use the document picker API, so you will not be able to add your own data source for images if the Messages app does not change.
I am trying to build an iOS application that will display all of the iOS device's photos in a view. The user should then be able to click each photo to select (multiple selections allowed) then after selecting, upload the photos to a webserver.
Is it possible to access the photos that are controlled by the Photos application? Does anyone know of any efficient way to get access to the photos (third party framework) and/or a tutorial?
Thanks
Apple's developer site lists the Assets Library Framework as a way "to access the pictures and videos managed by the Photos application." The documentation there is fairly extensive, and looking around the dev site more should yield several tutorials and example apps.
AFAIK you can't grab all images from camera roll and use them in your app but you can have a UIImagePickerController that lets the user choose the image from their camera roll and a delegate is fired when they select one (or take a picture depending on how you set it up) then you can use that image in your app.
I use a ContentObserver in my android application to receive a notification whenever a photo is taken. Obviously iOS doesn't use the intent system, so is there an equivalent or alternative way to do this? I would prefer not to write a full camera application if possible.
This is not quite possible. Even the latest Google+ application on iOS, with its Instant Upload feature does not get notified when photos are taken, it simply checks the asset library while the application is running, and then as long as possible while running in the background before getting timed out by the OS.
The following is from the Google+ help on the matter:
Note: Photos and videos will upload while the Google+ application is
open and for a brief period of time afterwards.
HTH
You cannot run in the background and get notified when a picture is taken and saved to the Camera Roll by another app on iOS.
That said, you don't really need to write a whole camera app to be able to let the user take pictures from within your app, or to access Camera Roll from within your running app.
Take a look at UIImagePickerController. It is really easy to let the user select or take a photo on iOS.
There is no equivalent to ContentObserver in iOS.