3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

play-services-adsを使用せず広告IDを取得する

Last updated at Posted at 2018-10-16

概要

  • 広告IDを利用するSDKの手順書によく com.google.android.gms:play-services-ads を記載してねと書いてあります。
  • が、2018/10に公開された play-services-ads-identifier の設定だけで ads 本体には依存せずに広告IDが取得できます。(AdvertisingIdClientが参照できる)

設定方法

app/build.gradle
dependencies {
    implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
}

依存関係グラフ

  • supportLibraryのバージョンを揃えてないですが...
\--- com.google.android.gms:play-services-ads-identifier:16.0.0
     \--- com.google.android.gms:play-services-basement:16.0.1
          \--- com.android.support:support-v4:26.1.0
               +--- com.android.support:support-compat:26.1.0 -> 28.0.0 (*)
               +--- com.android.support:support-media-compat:26.1.0
               |    +--- com.android.support:support-annotations:26.1.0 -> 28.0.0
               |    \--- com.android.support:support-compat:26.1.0 -> 28.0.0 (*)
               +--- com.android.support:support-core-utils:26.1.0 -> 28.0.0 (*)
               +--- com.android.support:support-core-ui:26.1.0 -> 28.0.0 (*)
               \--- com.android.support:support-fragment:26.1.0 -> 28.0.0 (*)

参照

3
2
0

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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?