What's difference between NSPhotoLibraryAddUsageDescription and NSPhotoLibraryUsageDescription?

前端 未结 5 1346
情深已故
情深已故 2020-12-18 18:17

My app get crashed today while updating on Xcode9, testing on iOS11. After adding NSPhotoLibraryAddUsageDescription then it works, even i already had NSPh

5条回答
  •  -上瘾入骨i
    2020-12-18 19:10

    There is a difference for write access based on the API asking for permission as well as the iOS version, so you need both.

    My app already had NSPhotoLibraryUsageDescription in order to use PHPhotoLibrary to save images.

    On iOS 11, that still works but if my app hasn't yet got permission then sharing an image via "Save Image" in a UIDocumentInteractionController causes a crash with a warning about NSPhotoLibraryAddUsageDescription. If permission has already been granted via PHPhotoLibrary I don't seem to need NSPhotoLibraryAddUsageDescription for "Save Image".

提交回复
热议问题