LoginSignup
19
10

More than 5 years have passed since last update.

"NSLocationWhenInUseUsageDescription"を設定しろとAppleからメールが来る

Last updated at Posted at 2019-03-29

2019/03/28の16:30くらいから、AppStoreへ提出用のアップロードをすると
以下のようなメールが返ってきて失敗してしまうようになった。
(ほぼ同じ状態のアプリを16:10にアップロードしたときは成功したのに・・・)

App Store Connect

Dear Developer,

We identified one or more issues with a recent delivery for your app, "***". Please correct the following issues, then upload again.
Missing Purpose String in Info.plist File. Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationWhenInUseUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting spring 2019, all apps submitted to the App Store that access user data will be required to include a purpose string.If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

Best regards,

The App Store Team

読んで字のごとく、位置情報にアクセスするAPIを使ってるならちゃんとinfo.plistに
NSLocationWhenInUseUsageDescriptionを書けよって意味なんですが、
私は位置情報なんて使ってませんし、CLLocationManagerに関する処理も書いてません。

そこで、位置情報を使う時に利用するframeworkで検索するとCoreLocation.framework
targetsのLinked Frameworks and Librariesに・・・。

対策

targetsからCoreLocation.frameworkを削除して、Cleanしてから再度ビルドしてアップロードするも、リジェクト。
確認すると全てのtargetsから消したのになぜかプロジェクトツリーにframeworkが居座っていたので、
Remove Refrenceで削除。

が、ダメ。

英文検索してみると、以下のような情報が。
https://github.com/twitter/twitter-kit-ios/issues/90

Upon submission to the app store this framework is generating a rejection even though I am not using Location for tweets.
App Storeへの送信時に、このフレームワークはツイートの場所を使用していないにもかかわらず拒否を生成しています。(Google翻訳)

とりあえず、TwitterKitを使っているとTweetComposeを利用するときに強制的にAPIが使われているようで・・・。
このレスポンスにもあるように、以下の情報をinfo.plistに追加して申請してみます。

色々と検索してみると、他にも使っていないのに自動レスポンスでこのメールを受け取ってる人が多数いるようですね・・・。

NSLocationWhenInUseUsageDescription
Your location is required to share you location within tweets
Twitterでのツイート時にあなたの場所を共有する場合に利用します。
info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is required to share you location within tweets</string>

とりあえずUploadを自動リジェクトされることはなくなりました。
completed processing.のメールも飛んできたので大丈夫そうです。

追記 : 審査も通りました。

19
10
1

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
19
10