jibon57 / nativescript-mediafilepicker

A complete file picker solution for NativeScript
Apache License 2.0
51 stars 36 forks source link

ImagePicker return no file name on IOS #97

Closed larxenne closed 4 years ago

larxenne commented 4 years ago

I tried the demo and I cannot make the ImagePicker works on IOS I tried on both an emulator and a real device.

The returned file path is always empty. This is what I got for the console log

CONSOLE LOG file:///app/main-view-model.ts:60:18: ==== object dump start ==== 0: { "type": "image", "rawData": {} } ==== object dump end ==== CONSOLE LOG file:///app/main-view-model.ts:68:22: undefined

jibon57 commented 4 years ago

Hi,

Make sure that you aren't selecting icloud images.

Thanks

larxenne commented 4 years ago

Hi,

No, the image is stored locally. It works well with videos audio and other files, just the ImagePicker has this issue.

Everything works well on android

mtenus commented 4 years ago

I have the same issue 👍 when I dump res.object.get('results') I get ⬇️

[
  {
    "type": "image",
    "rawData": {}
  }
]

I've checked it out using ios 13.3 (with android works fine)

mtenus commented 4 years ago

@jibon57 is it possible that you will check it out soon? Or if not when could it be achievable?

jibon57 commented 4 years ago

@acivier-serial will you please have a look this?

coderaven commented 4 years ago

Hi, is there any updates on this? And what is on IOS 13 that is possibly causing the issue? Thanks

tylerablake commented 4 years ago

Hi,

I just came across this but I am using "nativescript-imagepicker": "^6.1.2" in a project and I can retrieve images in iOS 13. If someone looks into this it might be worth looking into that plugin's implementation for help.

larxenne commented 4 years ago

Hi,

I ended up doing the same and using nativescript-imagepicker plugin instead

mtenus commented 4 years ago

I will start to use only verfied plugins. Never again unsupported packages :ok_hand:

coderaven commented 4 years ago

Me too, I ended up using nativescript-imagepicker. However, I still think this plugin is promising but of course, as with any other open source projects - it needs to be maintained by the community.

Will try to make a pull request for the new changes if no one else does it in a couple of days.

jibon57 commented 4 years ago

@coderaven thank you so much for your willingness to work. The native library isn't updating regularly & don't have that much expertise on native level too. I am thinking to use another library to replace image & video picker. I am checking the possibilities now. This new library will support iCloud items too.

kornerr commented 4 years ago

Not sure if anyone still cares, StackOverflow has the issue covered here: https://stackoverflow.com/a/58335293

Basically, before iOS 12 filename was usually retrieved from PHImageFileURLKey key of info dictionary. iOS 13 removed that key, so now people should use something like this instead:

let resourse = PHAssetResource.assetResources(for: self.phasset)
let url = resourse.first?.originalFilename