> For the complete documentation index, see [llms.txt](https://documentation.pushly.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.pushly.com/pushly-ja/integration/implementation-steps/android/sdk-kotlin-java/apurimessji.md).

# アプリメッセージ

Pushly PushSDKを使用してAndroidアプリにApp Messageサポートを追加するためのクイックスタートガイド

App Messages は、Push Notifications や Live Activities とは異なり、サブスクリプショントークンを必要とせずに、ユーザーベースとやり取りし、エンゲージすることができます。App Message は、プログラムで提供できるカスタム条件を含む、さまざまな基準に基づいて自動的に表示するよう設定できます。

カスタム条件付きの App Messages では、PushSDK により、これらの条件が満たされたことを通知するための便利なメソッドや、特定のライフサイクルイベントを監視する機能が提供されます。

## 前提条件

SDK に App Messages を統合する前に、以下の要件を満たす必要があります:

* を使用するアプリ [<mark style="color:青;">Jetpack（AndroidX）</mark>](https://developer.android.com/jetpack/androidx/migrate)
* Google Play ストア サービスがインストールされた、API 19 以上（Android 4.4）を実行する Android デバイスまたはエミュレーター。
* App Messages をサポートする PushSDK リリース（下のバージョンサポート表を参照）

## ステップ 1: Android SDK のセットアップ

アプリケーションが **まだ** PushSDK を使用していない場合は、ネイティブアプリ Push のセットアップガイドをご覧ください: [Android](/pushly-ja/integration/implementation-steps/android.md).

すでに PushSDK を使用しているアプリケーションでは、App Message サポートを含む後のバージョンへのアップグレードが必要になる場合があります。以下の表を使用して、インストールのアップグレードが必要かどうかを判断してください。

<table><thead><tr><th width="191">SDK</th><th>App Messages をサポートする最初のバージョン</th></tr></thead><tbody><tr><td>Java / Kotlin</td><td>1.2.0+</td></tr><tr><td><a href="/pushly-ja/integration/implementation-steps/react-native.md">React Native SDK</a></td><td>1.2.0+</td></tr><tr><td><a href="/pushly-ja/integration/implementation-steps/flutter.md">Flutter SDK</a></td><td>1.2.0+</td></tr></tbody></table>

{% tabs %}
{% tab title="app/build.gradle" %}

* 対象になっていることを確認してください `com.pushly.android:pushsdk:[1.2, 2.0[` をアプリの gradle で。
* gradle sync を実行します。

```gradle
dependencies {
    ...
    implementation 'com.pushly.android:pushsdk:[1.2, 2.0['
}
```

{% endtab %}
{% endtabs %}

## ステップ 2: App Message の作成とスケジュール設定

Pushly プラットフォームを使用して、最初の [App Message](/pushly-ja/platform/apurimessji.md).

## ステップ 3:（任意）App Message のカスタム条件をトリガーする

カスタム条件を使用する場合、PushSDK はこれらの条件をプログラムで提供し、その後、現在アクティブで提供された条件に一致する App Messages を評価するトリガーとなります。

ほとんどの場合、一度に 1 つの条件がトリガーされ、評価されます。このような場合は、 `trigger(condition: String, value: String)` のメソッドシグネチャを使用します。

{% tabs %}
{% tab title="Kotlin" %}
{% code fullWidth="false" %}

```kotlin
PushSDK.AppMessages.trigger(condition = "enabled_subscription", value = "true")
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}

```java
PushSDK.AppMessages.trigger("enabled_subscription", "true");
```

{% endtab %}
{% endtabs %}

ただし、評価のために複数の条件を一度にトリガーする方が便利な場合もあります。このような場合は、任意の数の条件を含む HashMap を `trigger(conditions: HashMap<String, String>)` のメソッドシグネチャを使用します。

{% tabs %}
{% tab title="Kotlin" %}
{% code fullWidth="false" %}

```kotlin
PushSDK.AppMessages.trigger(conditions = hashMapOf(
    "enabled_subscription" to "true",
    "subscriber_tier" to "premium"
))
```

{% endcode %}
{% endtab %}

{% tab title="Java" %}

```java
PushSDK.AppMessages.trigger(Map.of(
    "enabled_subscription", "true",
    "subscriber_tier", "premium"
));
```

{% endtab %}
{% endtabs %}

## ステップ 4:（任意）App Message のライフサイクルイベントを監視する

こちらの [SDK コールバック](/pushly-ja/integration/implementation-steps/android/sdk-kotlin-java/sdkkrubakku.md#app-message-lifecycle-callbacks) ドキュメントで、App Messages のライフサイクルイベントの処理に関する情報をご覧ください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://documentation.pushly.com/pushly-ja/integration/implementation-steps/android/sdk-kotlin-java/apurimessji.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
