-1

On Android I understand an app can ingest an image file from the user's Downloads folder, and then use that image to direct content inside the app. Amazon MP3 Cloud Player is good example.

I understand that on iOS the Saved Photos folder can be accessed by apps as well, using the UIImagePickerController Class Reference. I understand that I can limit which media assets can be browsed, just video or just photos, but can I tell the app to only launch the media asset picker for the user ONLY if an exact-match to photo file extension is made in the first-place?

In other words: IF in the Saved Photos folder there is a .ONE or a .TWO file present, then launch the media browser, and only show .ONE or .TWO files, if not, do not launch the media browser.

I want to be able to use a custom file extension -not the standard PNG, JPG, etc...

Ultimately my goal is to use this custom image file as a kind of token that tells the app the user has done something in the browser to acquire the image file, and therefore is entitled to a special experience in the app.

1 Answers1

0

What you want is not a UIImagePicker, because you need to enumerate user photos programmatically. Have a look at ALAssetsLibrary, with which you can enumerate ALAssets, which are proxy objects for saved photos (and videos).

Upon further reading: I don't think your custom extension idea would work. And it shouldn't, because you're exposing implementation details to the user by putting certain specialized files into a content library where they don't belong (which probably won't work). Do not misuse OS facilities like that. It will only get your app rejected from the app store (if it even works), create more headaches in implementation, and create very poor user experience. While this might not be enforced on Android, it is a bad idea even there, but on iOS, you won't even be able to release your app to the public.

See this question for how to declare your app to open specific document types (which means that when the user downloads a .yourSpecialFileType file in Safari, it will launch your app and hand the file over to you).

Community
  • 1
  • 1
fzwo
  • 9,842
  • 3
  • 37
  • 57