iOSアプリを提出しようとしたらuniqueIdentifierで怒られた

昨日、Twitter API 1.1移行で修正したアプリを iTunesConnectに提出しようとしたら、Validationで怒られた。

* Your App contains non-public API usage. Please review the errors, correct them, and resubmit your application.
* Apps are not permitted to access the UDID and must not use the uniqueIdentifier method of the UIDevice. Please update your apps and servers to associate users with the Vendor or Advertiser identifiers introduced in iOS 6.
* If you think this message was sent in error and that you have only used Apple-published APIs in accordance with the guidelines, send the app's nine-digit Apple ID, along with detailed information about why you believe the above APIs were incorrectly flagged, to appreview@apple.com. For further information, visit technical support information page at http://developer.apple.com/support/technical/.

だって。


という訳で、今回はこの問題を解決して提出したメモ。

犯人は古いAdMobのSDK

まずは自分のコードの中で uniqueIdentifier を使っていないかどうか確認したけど見つからなかった。
ってか、そんなの使っている箇所がないのは自分で書いたコードだからわかってる!


というわけで、原因はなんだろう?と思って早速ググって見つけたのがこのページ。

どうやらライブラリに犯人がいるかもしれないらしい。
というわけで、上記ページで参照されていたページを確認。

ここで、使っているライブラリが問題の uniqueIdentifier を使っているかどうか確認する便利コマンドを確認。
早速、自分のアプリでも試してみる。

iMac-i3-27:nemustamp2 paraches$ find . | grep -v .svn  | grep "\.a" | grep -v "\.app" | xargs grep uniqueIdentifier
Binary file ./libGoogleAdMobAds.a matches
iMac-i3-27:nemustamp2 paraches$

サックリ犯人を発見。
犯人は libGoogleAdMobAds でした!


アプリのプロジェクトを確認してみると、使っている AdMob の SDK はバージョン 6.2.1。
Google のページで調べてみると最新は 6.4.2。

ってか、AdMob のレポートページを良く見るとちゃんとワーニングが表示されてた!

AdMob のレポートページなんて全然見ないから気付かなかったよ…。


というわけで、AdMobの SDKを 6.4.2にしたら Validationで怒られることなしに、無事アプリを提出できました〜。