42
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

iOS11では画像をアルバム保存するアプリはPrivacyへの追記が必要になりました

Last updated at Posted at 2017-07-06

iOS11のbeta版でアプリのデバッグを行なっていたら、以下のようなエラーでクラッシュしました。

[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description.  
The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data.

どうやらiOS11 later向けに制約が増えていたようです。

CocoaKeys#NSPhotoLibraryAddUsageDescription
アプリがユーザーのフォトライブラリへの書き込み専用アクセスを求める理由を説明します。

UIImageWriteToSavedPhotosAlbumなどを利用して撮影した画像を保存する機能などを提供している場合はiOS11が出る前にinfo.plistにPrivacyの追記をしておいた方が良いですね。

info.plist
<key>NSPhotoLibraryAddUsageDescription</key>
<string>撮影した写真を保存します</string>
42
21
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
42
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?