コガネブログ

平日更新を目標に Unity や C#、Visual Studio、ReSharper などのゲーム開発アレコレを書いていきます

【iOS】This app has crashed because it attempted to access privacy-sensitive data without a usage description.

概要

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

ATTrackingManager の requestTrackingAuthorizationWithCompletionHandler を実行した時に
上記のエラーが出てアプリが停止した場合は

f:id:baba_s:20201129203426p:plain

Info.plist の「Information Property List」を選択して「+」を押して

f:id:baba_s:20201129203611p:plain

「Privacy - Tacking Usage Description」を選択して

f:id:baba_s:20201129203620p:plain

「Privacy - Tacking Usage Description」を追加できたら「Value」の欄に文字列を入力します

f:id:baba_s:20201129210339p:plain

これでアプリを再度ビルドして起動すると
アプリが正常に動作するようになり、前項で入力した文字列が
確認ダイアログで表示されるようになります