cordova-plugin-photo-library icon indicating copy to clipboard operation
cordova-plugin-photo-library copied to clipboard

App Crash in ios 13 version.

Open priyasamyal opened this issue 4 years ago • 8 comments

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

priyasamyal avatar Sep 30 '19 07:09 priyasamyal

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

xmarkclx avatar Oct 10 '19 23:10 xmarkclx

@xmarkclx your fork not working with ios13.1

rafaelmrdyn avatar Oct 11 '19 12:10 rafaelmrdyn

@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?

xmarkclx avatar Oct 11 '19 13:10 xmarkclx

@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

rafaelmrdyn avatar Oct 11 '19 14:10 rafaelmrdyn

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 [email protected] 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 .

xmarkclx avatar Oct 11 '19 22:10 xmarkclx

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(file_url as String, libraryItem)

in the 314 line of PhotoLibraryService.swift file

PHImageFileURLKey deprecated in ios 13, instead use PHImageFileUTIKey

rafaelmrdyn avatar Oct 14 '19 13:10 rafaelmrdyn

@iamrafo Ok, added that fix on [email protected].

Thanks.

xmarkclx avatar Oct 14 '19 13:10 xmarkclx

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(file_url 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!

abcoskn avatar Oct 17 '21 21:10 abcoskn