0

I am getting the user selected image in PHAsset format. and I want to get the image path.

My goal is to upload the image to Firebase and based their docs, I need to have the image path.

I found from researching that I need to get the metadata of the image first and store it in local file and then I can retrieve the URL. Is it correct?

My question here is (If the above correct), how can I get the metadata of PHAsset image format?

Ozgur Vatansever
  • 49,246
  • 17
  • 84
  • 119
Source
  • 99
  • 1
  • 1
  • 7

1 Answers1

2

If you want to retrive the image file Path from your PHAsset address then use this function:

[asset requestContentEditingInputWithOptions:[PHContentEditingInputRequestOptions new] completionHandler:^(PHContentEditingInput *contentEditingInput, NSDictionary *info) {
        NSURL *imageURL = contentEditingInput.fullSizeImageURL;
        }];

asset=PHAsset *asset

khusboo suhasini
  • 293
  • 2
  • 16