[flutter ios]AppStoreにアップロードしたら弾かれた話

題名通り作ったflutterのアプリをストアにアップロードしようとしたところ、どうも非推奨になった機能を使っているパッケージがあるようで弾かれてしまったという内容のメールが届きました。
これ、TestFlightもできないみたいですね。早速対応していきます。

拒否された原因を知る

まずはメールの文面から拒否された原因をみてみましょう。

ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. 
Instead, use WKWebView for improved security and reliability. 
Learn more (https://developer.apple.com/documentation/uikit/uiwebview).

Though you are not required to fix the following issues, we wanted to make you aware of them:

ITMS-90683: Missing Purpose String in Info.plist - 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 are 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).

とりあえず対応しましょう。

UIWebView

どうもUIWebViewが非推奨になり、代わりにWKWebViewを使えという内容みたいです。基本的に、メンテナンスされていないパッケージを使っている場合発生しやすいです。対策法はメンテされているパッケージに移行するくらいしかありません。パッケージのgithubページにてissueで「UIWebView」とかで検索すると、同様の質問が上がっているかも知れません。類似のパッケージの情報等あるかもしれないので、確認してみましょう。

今回、私はflutter_twitterというパッケージを使っていたことが原因でした。似たようなパッケージがないか検索したところ、「twitter_login」というパッケージがあったのでこれに変更。実装に関しては別記事で解説します。

その後、再アップロードすると無事に自動審査は通過できました。30分くらいで通過メールが届きました。

ただ、この「審査に通らなかったバージョン番号」は最新版としてストアに情報は残っているみたいで、バージョン番号をあげないとダメでした。気をつけてください。