terikon / cordova-plugin-photo-library

Maintainer needed. Please contact if you're using this library in your project
MIT License
149 stars 295 forks source link

App Crash in ios 13 version. #179

Open priyasamyal opened 4 years ago

priyasamyal commented 4 years ago

Following are the logs generated in iOS version 13. Works fine in previous pervious. Please update ASAP. Unexpectedly found nil while unwrapping an Optional value: file /Volumes/Data/Projects/Destinate/destinate/platforms/ios/destinate/Plugins/cordova-plugin-photo-library/PhotoLibraryService.swift, line 317 2019-09-30 12:36:26.209539+0530 destinate[503:147761] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Volumes/Data/Projects/Destinate/destinate/platforms/ios/destinate/Plugins/cordova-plugin-photo-library/PhotoLibraryService.swift, line 317

xmarkclx commented 4 years ago

I'm using my fork with iOS 13. There are instructions to use it as a replacement for this one if you are interested:

https://github.com/xmarkclx/cordova-plugin-photo-library-sism

rafaelmrdyn commented 4 years ago

@xmarkclx your fork not working with ios13.1

xmarkclx commented 4 years ago

@xmarkclx your fork not working with ios13.1

That's really odd, I was just testing it yesterday, and am in fact using it right now on an iOS 13 iPhone and iPadOS 13 iPad Pro.

Are you sure you removed the original photo library?

What error are you getting?

rafaelmrdyn commented 4 years ago

@xmarkclx your fork not working with ios13.1

That's really odd, I was just testing it yesterday, and am in fact using it right now on an iOS 13 iPhone and iPadOS 13 iPad Pro.

Are you sure you removed the original photo library?

What error are you getting?

yes i'm sure i removed original library and use yours, and there are no errors but plugin does not getting images anyway

xmarkclx commented 4 years ago

Oh, i only use the save image and get permissions function, we used a custom designed gallery for everything else.

On Fri, Oct 11, 2019 at 10:24 PM Rafael Muradyan notifications@github.com wrote:

@xmarkclx https://github.com/xmarkclx your fork not working with ios13.1

That's really odd, I was just testing it yesterday, and am in fact using it right now on an iOS 13 iPhone and iPadOS 13 iPad Pro.

Are you sure you removed the original photo library?

What error are you getting?

yes i'm sure i removed original library and use yours, and there are no errors but plugin does not getting images anyway

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/terikon/cordova-plugin-photo-library/issues/179?email_source=notifications&email_token=ABKEQ7HJENGSVICUTRBOSCLQOCEABA5CNFSM4I3W6DB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBAFDJI#issuecomment-541086117, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKEQ7AXYBTPGQQPG6K6IITQOCEABANCNFSM4I3W6DBQ .

rafaelmrdyn commented 4 years ago

i solve this issue by replacing

_let file_url:URL = info!["PHImageFileURLKey"] as! URL completion(file_url.relativePath, libraryItem)_ to

_let file_url:NSString = (info![“PHImageFileUTIKey”] as? NSString)! completion(fileurl as String, libraryItem)

in the 314 line of PhotoLibraryService.swift file

PHImageFileURLKey deprecated in ios 13, instead use PHImageFileUTIKey

xmarkclx commented 4 years ago

@iamrafo Ok, added that fix on cordova-plugin-photo-library-sism@2.2.95.

Thanks.

abcoskn commented 2 years ago

i solve this issue by replacing

_let file_url:URL = info!["PHImageFileURLKey"] as! URL completion(file_url.relativePath, libraryItem)_ to

_let file_url:NSString = (info![“PHImageFileUTIKey”] as? NSString)! completion(fileurl as String, libraryItem)

in the 314 line of PhotoLibraryService.swift file

PHImageFileURLKey deprecated in ios 13, instead use PHImageFileUTIKey

You saved my day, thank you!