Google Play Core Library の概要

このページでは、Google Play Core Library と、プロジェクトへの追加方法について説明します。

Google Play Core Library は、Google Play ストアにおけるアプリのランタイム インターフェースです。次のような操作を行うことができます。

Play Core Library は、JavaネイティブUnity で利用できます。最新リリースについて詳しくは、リリースノートをご覧ください。

Google Play Core Java and Kotlin Library からの移行

Play Core Java and Kotlin Library は、機能別に複数の Android ライブラリに分割されました。これにより、Play Core ライブラリがアプリに追加するサイズが減り、個々の機能のリリース サイクルを短縮できます。

この移行で各機能の動作は変わりません。唯一の大きな変更点は、新しいバージョンで Google Play 開発者サービスの Task API が採用されたことです。

新しいライブラリに移行してバグを修正し新機能を活用するには、次のリストを使用してください。build.gradle ファイルに複数のライブラリを一度にインポートするだけで、複数の Google Play 機能を使用できます。

一般的な移行手順

  1. Task オブジェクトの既存の import ステートメントを import com.google.android.play.core.tasks.*; から import com.google.android.gms.tasks.*; に更新します。クラス名に変更はありません。
  2. build.gradle ファイルにある以前の Play Core ライブラリの import をすべて削除します。

Play Asset Delivery Library を統合する

Groovy

// In your app’s build.gradle file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // So, make sure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:asset-delivery:2.2.1'

    // For Kotlin users also add the Kotlin extensions library for Play Asset Delivery:
    implementation 'com.google.android.play:asset-delivery-ktx:2.2.1'
    ...
}

Kotlin

// In your app’s build.gradle.kts file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // So, make sure you also include that repository in your project's build.gradle file.
    implementation("com.google.android.play:asset-delivery:2.2.1")

    // For Kotlin users also import the Kotlin extensions library for Play Asset Delivery:
    implementation("com.google.android.play:asset-delivery-ktx:2.2.1")
    ...
}

Play Feature Delivery Library を統合する

Groovy

// In your app’s build.gradle file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // So, make sure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:feature-delivery:2.1.0'

    // For Kotlin users, also add the Kotlin extensions library for Play Feature Delivery:
    implementation 'com.google.android.play:feature-delivery-ktx:2.1.0'
    ...
}

Kotlin

// In your app’s build.gradle.kts file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // Make sure you also include that repository in your project's build.gradle file.
    implementation("com.google.android.play:feature-delivery:2.1.0")

    // For Kotlin users, also import the Kotlin extensions library for Play Feature Delivery:
    implementation("com.google.android.play:feature-delivery-ktx:2.1.0")
    ...
}

Play In-App Review Library を統合する

Groovy

// In your app’s build.gradle file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // Make sure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:review:2.0.1'

    // For Kotlin users, also add the Kotlin extensions library for Play In-App Review:
    implementation 'com.google.android.play:review-ktx:2.0.1'
    ...
}

Kotlin

// In your app’s build.gradle.kts file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // Make sure you also include that repository in your project's build.gradle file.
    implementation("com.google.android.play:review:2.0.1")

    // For Kotlin users, also import the Kotlin extensions library for Play In-App Review:
    implementation("com.google.android.play:review-ktx:2.0.1")
    ...
}

Play In-App Update Library を統合する

Groovy

// In your app’s build.gradle file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // Make sure you also include that repository in your project's build.gradle file.
    implementation 'com.google.android.play:app-update:2.1.0'

    // For Kotlin users, also add the Kotlin extensions library for Play In-App Update:
    implementation 'com.google.android.play:app-update-ktx:2.1.0'
    ...
}

Kotlin

// In your app’s build.gradle.kts file:
...
dependencies {
    // This dependency is downloaded from the Google’s Maven repository.
    // Make sure you also include that repository in your project's build.gradle file.
    implementation("com.google.android.play:app-update:2.1.0")

    // For Kotlin users, also import the Kotlin extensions library for Play In-App Update:
    implementation("com.google.android.play:app-update-ktx:2.1.0")
    ...
}

Play Core ソフトウェア開発キットの利用規約

最終更新日: 2020 年 9 月 24 日
  1. Play Core ソフトウェア開発キットを使用することにより、Google API 利用規約(「API 利用規約」)に加えて、本規約に同意したことになります。各規約の間に矛盾がある場合は、本規約が API 利用規約よりも優先されます。本規約と API 利用規約をよくお読みください。
  2. 本規約において、「API」とは Google の API、その他のデベロッパー向けサービス、および関連するソフトウェア(あらゆる再配布可能コードを含む)を意味します。
  3. 「再配布可能コード」とは、API を呼び出す Google 提供のオブジェクト コードまたはヘッダー ファイルを指します。
  4. 本規約および API 利用規約の規定に従い、API クライアントの一部として含める形でのみ、再配布可能コードをコピーして配布することができます。Google とそのライセンサーは、再配布可能コードとそれに含まれる一切の権利、権原、および利益(すべての知的財産権とその他の所有権を含む)を保有します。デベロッパーは、再配布可能コードの修正、翻訳、派生物の作成をしてはなりません。
  5. Google は、通知を行い、Play Core ソフトウェア開発キットの使用を拒否する機会を提供したうえで、いつでも本規約を変更することができます。Google は、本規約の変更の通知を https://developer.android.com/guide/playcore/license に掲載します。変更が遡って適用されることはありません。