普通にアップデートできていたアプリが立て続けにPLA3.1.12で引っ掛かりました。
PLA3.1.12追加されてしばらく立つのに何故今頃?と思いました。
審査の規制強化というニュースはよく目にしますが、この辺も強化対象に含まれたのでしょうかね。当初、よくわからず困惑したのでメモ。
PLA 3.1.12とは?
ざっくり言うと、"Advertising Identifier"(=広告用識別子)を広告以外の目的で使用してはダメですよ。ということ。公式ドキュメントは下記URL参照。
・iOS Developer Program License Agreement (PLA)
https://developer.apple.com/programs/terms/ios/standard/ios_program_standard_agreement_20140909.pdf
3.3.12 You and Your Applications (and any third party with whom You have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier.
Resolution Centerでの内容
リジェクト理由として以下のようなメッセージが届きます。
PLA 3.3.12
Furthermore, we found your app uses the iOS Advertising Identifier but does not include ad functionality. This does not comply with the terms of the iOS Developer Program License Agreement, as required by the App Store Review Guidelines.
Specifically, section 3.3.12 of the iOS Developer Program License Agreement states:
"You and Your Applications (and any third party with whom you have contracted to serve advertising) may use the Advertising Identifier, and any information obtained through the use of the Advertising Identifier, only for the purpose of serving advertising. If a user resets the Advertising Identifier, then You agree not to combine, correlate, link or otherwise associate, either directly or indirectly, the prior Advertising Identifier and any derived information with the reset Advertising Identifier."
Note: iAd does not use the AdSupport framework, ASIdentifierManager, or the Advertising Identifier. Therefore they are not required for iAd implementations and should not be included in your app for iAd support.
If your app is serving ads, please:
Ensure that you have tested your app on a device, not just the simulator, and that you have removed all previous versions of your app prior to testing
Provide us the steps to locate ads in your app
If your app does not serve ads, please check your code - including any third-party libraries - to remove any instances of:
class: ASIdentifierManager
selector: advertisingIdentifier
framework: AdSupport.frameworkIf you are planning to incorporate ads in a future version, please remove the Advertising Identifier from your app until you have included ad functionality.
To help locate the Advertising Identifier, use the “nm” tool. For information on the “nm” tool, please see the nm man page.
If you do not have access to the libraries' source, you may be able to search the compiled binary using the "strings" or "otool" command line tools. The "strings" tool lists the methods that the library calls, and "otool -ov" will list the Objective-C class structures and their defined methods. These techniques can help you narrow down where the problematic code resides.
何が問題か・・?
GoogleAnalyticsSDKをはじめ, FacebookSDK, AdmobSDKなど多くのライブラリで"Advertising Identifier"が使われていたが、突然のPLA 3.1.12によりリジェクトが多発。
ググった感じではリジェクトされる理由は大きく2パターンあるようです。
1. Advertising Identifierを使用しているが、広告が表示されていない。
2. Advertising Identifierが広告以外で使われてる。
必ずリジェクトされるわけではない?
レビュワーによってリジェクトされたり、されなかったりみたいです。
アップルの審査規制や方針もよく変わるので、本当のところはわかりませんが。
私自身もなぜ今?という感じでした。
PLA 3.1.12に引っ掛かるまでの流れ。。
たぶん多くの方がこういうパターンなのかな。。
- GoogleAnalyticsなどのSDKで"Advertising Identifier"の使用が必須。
- そのため、アプリ申請時に"Advertising Identifier(IDFA)"の使用にもチェック。
- ( 今迄はそれで審査通過できていた )
- ( PLA 3.1.12追加 )
- 今迄通りアプリ申請を行う。
- リジェクトされる。
GoogleAnalyticsSDKとかFacebookSDKとか利用している方は多いと思うので、これはもうリジェクト多発しますよね。
(規約をこまめにチェックしとけって話なんでしょうが・・)
解決方法
PLA 3.3.12の対策方法です。
ケース1の対応は簡単。主にケース2について。
ケース1. Advertising Identifierを使用しているが、広告が表示されていない。
=> 広告が表示されているスクリーンショットなどをResolutionCenterで示せば通るようです。広告を表示しないアプリの場合、次の2の対応。
ケース2. Advertising Identifierが広告以外で使われてる。
=> Advertising Identifierが使われている場所を探して除外する。
Advertising Identifierの使用箇所の探し方
nm, otoolなどリバースエンジニアリングコマンドをバイナリファイルにかけれは見つけ出せます。
- バイナリファイルはAdhocで生成されるipaファイルを解凍すれば取得できます。
- ipaファイルはただのzipファイルなので普通にunzipコマンドで解凍できます。
アプリのバイナリファイル取得
ipaファイルを解凍するとPayloadというフォルダがでてきます。
フォルダ構成はこんなです。
[]$ cd myapp.ipa
[]$ unzip myapp.ipa
[]$ cd Payload
[]$ tree
.
|-- Info.plist
|-- Products
| `-- Applications
| `-- myapp.app
`-- dSYMs
`-- myapp.app.dSYM
`-- Contents
|-- Info.plist
`-- Resources
`-- DWARF
`-- myapp
Products以下にmy.appファイルにリバースエンジニアリングコマンド実行。
otool,strings,nm,class-dumpと調べられるコマンドはたくさんありますが。各コマンドの詳細については情報はたくさんあると思うので省略します。
"advertisingIdentifier"というメソッドが存在しないか確認します。
[]$ cd ./Products/Applications
[]$ otool -ov myapp |grep advertisingIdentifier
[]$ strings myapp |grep advertisingIdentifier
[]$ nm myapp |grep advertisingIdentifier
[]$ class-dump myapp |grep advertisingIdentifier
ついでにバイナリに含まれているフレームワークもチェック。
advertisingIdentifierはAdSupport.frameworkに含まれているので、
このAdSupport.frameworkが見つかった場合、除外しておきましょう。(XCodeのBuild Phasesで)
// 使用しているフレームワーク一覧を取得する。
$ otool -l myapp |grep AdSupport
また、grepでプロジェクト丸々検索してみるとどこで使われるがわかります。引っ掛かった.aファイルを上記のnm,otoolコマンドを実行すれば中身の詳細も掴めます。
[]$ grep -R advertisingIdentifier ./
Binary file .//cocos2d/extensions/google-analytics/ios/sdk/libAdIdAccess.a matches
Binary file .//cocos2d/plugin/plugins/admob/proj.ios/Admob/libGoogleAdMobAds.a matches
Binary file .//cocos2d/plugin/plugins/flurry/proj.ios/libFlurry.a matches
参考サイト
・iOS Developer Program License Agreement (PLA)
- Appleのデベロッパに広告識別子の規則遵守が義務化, 違反者はApp Storeから拒絶される
- IDFA(advertisingIdentifier)「PLA 3.3.12」リジェクトとの闘いの軌跡
- 「PLA 3.3.12」でリジェクトされました
- advertisingIdentifierが原因のリジェクトに対応する。