Jump to content
Sign in to follow this  
Halcon

Save and get images on iOS

Recommended Posts

Hello friends:

 

I'm developing an App that users can make their own images. That images must be saved on local or public folder (destination is indifferent), but I need that users can view their images on the gallery of device.

 

By example, WhatsApp uses their own gallery images folder (as separate folder with "WhatsApp" name), and users can view the images on iOS "Photos" official App.

 

I need as well get (load in to TImage) the images saved. Definitely, I need load and save images from my App, and images should be able to see in General gallery.

 

I Tried to use IFMXImageManagerService, but is not supported by iOS. I've been looking for a solution for 3 days, please, any recommendation?

 

Thanks in advance.

Jose.

Share this post


Link to post
Guest

I dont iOS phones, but is not basic function of system found the pictures on smartphones?

I see in my Android, that my pictures is finded be where it is.

 

hug

Share this post


Link to post
3 hours ago, emailx45 said:

I dont iOS phones, but is not basic function of system found the pictures on smartphones?

I see in my Android, that my pictures is finded be where it is.

 

hug

No hug..., iOS is very very protected. You can save images with IFMXPhotoLibrary, but you haven't control of it. iOS saved with other name and then you can't access to that image.

 

I can't find any method for save and get images that can view on the phone gallery. Only can get images with user intevention (you call to TTakenPhotoFromLibrary and user must select the image that loads in to TImage in the App).

 

I think that must exists any method, because apps like WhatsApp or DJI (drones) have their own folder gallery that can view in to phone gallery, and that images can save and/or load by that Apps.

Share this post


Link to post
3 hours ago, Halcon said:

I can't find any method for save and get images that can view on the phone gallery

Since iOS 8, use the PhotoKit framework to access photos in albums:

 

  PhotoKit | Apple Developer Documentation

 

I have an import for it, here: 

 

  https://github.com/DelphiWorlds/Kastri/blob/master/API/DW.iOSapi.Photos.pas

 

Which likely needs updating, because I think I imported it around iOS 9 era. This will not help you however, if you are saving photos as files somewhere. You can retrieve the filename from an asset in the gallery, bearing in mind can be traps in doing so: 

 

  https://medium.com/@slk11075/traps-for-phasset-how-to-get-filename-from-phasset-67d856e75c64

 

  • Like 2
  • Thanks 1

Share this post


Link to post

I'am with the same problem.... Solutions or samples for the kastri library or other?

Share this post


Link to post

Have you tried load/save with TBitmap."Save/Load"ToFile(TPath.Combine(TPath.GetDocumentsPath, 'myApp') + 'FileName.ext') ?

Edited by KodeZwerg

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×