Using ALAsset, I get a nil answer for a lot of pictures fetched from iCloud in my app when calling the method : defaultRepresentation.
However, when I call "thumbnail" I get the associated small picture.
It mostly happens when the picture has just been added on iCloud from another device. My assumption was that the picture was not fully synchronised yet.
I've read that in this case, I need to subscribe to the ALAsset notifications, thus I could know when the picture is downloaded and update my UI. But some of them are never correctly downloaded, even if I relaunch my app, still nothing.
The strange "workaround" that I found is going in iPhoto and open the pictures in full screen on the device. The issue disappear only for the pictures I opened but remains for the others.
Finally, someone here wrote that it's possible to "force" the download by calling "requestDefaultRepresentation" but this method is not in the Apple documentation so an app using it could be rejected.
My question is : Is there an authorised method to fetch those pictures without asking the user to go in iPhoto ?
Related
Are there ever circumstances where the localIdentifier could change or not be accurate? I'm working on an application that backs up photos and have been told by my colleagues that the localIdentifier can't be trusted. However, after doing some research I have been unable to find anyone talking about this.
LocalIdentifiers sometimes change after updating the iOS version.
I've seen the PHAsset.localIdentifiers (Photo API) change after iOS updates twice - in my own Apps. The last time was after updating to iOS 11. The app in question kept track of localIdentifiers so specific images could be found/sorted according to various predicates.
As soon as the update from iOS10 to 11 finished, all the localIdentifiers saved locally by the app became useless as they didn't match any device images, although they still existed in the camera roll.
Like you I've searched for info on this subject without success. Sorry that my reply is bad news.
Use PHCloudIdentifier everywhere. You can use myCloudIdentifier.stringValue if you need it for data storage purposes.
Use cloudIdentifiers(forLocalIdentifiers:) method to convert from local to cloud and the sister method, localIdentifiers(for: [PHCloudIdentifier]), to convert back again.
I have a photo location app which allows the users to take a photo of the location when saving. Up until IOS8 whenever an update was applied all previously entered info was saved, including the image taken.
Since IOS8, all info is retained but the images no longer show, this causes the App to crash when trying to share locations via Facebook, Twitter etc because it is expecting an image.
Is there anything specific i should be looking for relating to behaviour since the new OS?
I'm building an app that is supposed to monitor picture taking even if the app is in the background.
For example:
A user opens the app, insert some settings and then puts the app in the background (locks the device or something). When the user opens the device again and take a photo with the camera, my app needs to catch that event.
I read some tutorials about the ALAssetsLibraryChangedNotification class and didn't exactly understand if this is what am I looking for because it doesn't say if this runs when app is in background.
I was wondering if someone here has some experience with this kind of thing and can give me some input about this kind of thing maybe an observer? Maybe a service? Any ideas?
I want to give to the user of my app the ability to share a photograph without having an internet connection. It is quite hard to explain but I'll do my best. Basically in my app a user can press on a plus button to take a shot using their iPhone. This image is then uploaded on the Internet (Dropbox) in a common folder that can be accessed by all app users. When other users open the app, the image that has been uploaded is downloaded on their device. Since there might be more than one image, the app refreshes itself once in a while, and downloads the new photographs. I want to do the same thing using the bluetooth (or airdrop). When one device takes a picture, this is saved on the device, and sent to all app users nearby. These users can edit it, send it back to the original device where it can be accessed by everyone. basically the original device acts as a server, and all other devices stream the information from that device. The whole purpose of this is to have, say 15 different iOS devices all in the same room in sync which display the same exact thing. When someone edits, all the other people will see it, as if they where in sync with "the cloud" (which now is Dropbox).
I understood that this might be possible with MultipeerConnectivity.framework as it permits more than one device to be connected at the same time. I also found an example app called beam it: http://arctouch.com/beamit/
What I'm asking here is not really for some code, rather some indications on how I could approach the problem.
I'm developing a AIR App that asks the user to take a photo or video and upload it to a server.
Everything was OK with Android, but I found out that MediaPromise.file was null on iOS.
I don't need/want to manipulate the image/video at all, I just need to get this File/FileReference and upload it to the server.
My problem is that, as iOS doesn't give me a File from the MediaPromise, I don't have anything to upload.
Googling around I found out how to, asynchronously, load the the data (with the Loader.loadFilePromise()) from the promise, but I don't know how to encode it as a video when I call camera.launch(MediaType.VIDEO); (where camera is a CameraUI instance).
I'm handling the camera.launch(MediaType.IMAGE); call just fine already, but I really want to get the file directly from the OS, if it is possible, so I don't need to encode it myself.
To sum it up, I need to upload the photo/video the user just took with the CameraUI API on the iOS.
How can I do this?
note: I can provide some code if needed...
This seems to be what you're looking for...AIR for iOS - Taking & Uploading Photos