> 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/react-native/sdk-react-native/apurimessji.md).

# アプリメッセージ

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

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

## 前提条件

SDKと統合する前に、以下の要件を満たしている必要があります:

* すでにPushSDKと統合済みのReact Nativeアプリケーション
* App MessagesをサポートするPushSDKリリース（下のバージョンサポート表を参照）

<table><thead><tr><th width="191">SDK</th><th>App Messages対応の最古のバージョン</th></tr></thead><tbody><tr><td>React Native SDK</td><td>1.2.0+</td></tr><tr><td><a href="/pages/46dc9b7bbdc4d0e5260124a0fe147eacc0639579">Java / Kotlin</a></td><td>1.2.0+</td></tr><tr><td><a href="/pages/70bb5e89a077a99158719785ec312e563b2fa43d">Objective-C / Swift</a></td><td>1.3.0+</td></tr></tbody></table>

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

アプリケーション向け **まだ** PushSDKを使用していない場合は、 [React Native](/pushly-ja/integration/implementation-steps/react-native.md).

すでにPushSDKを使用しているアプリケーションでは、App Messageサポートを含む後続バージョンにアップグレードする必要がある場合があります。

{% tabs %}
{% tab title="Yarn" %}

```sh
yarn add @pushly/push-sdk-react-native@">=1.2.0 <2.0.0"
```

{% endtab %}

{% tab title="NPM" %}

```sh
npm install --save @pushly/push-sdk-react-native@">=1.2.0 <2.0.0"
```

{% endtab %}
{% endtabs %}

## ステップ2: App Messageの作成とスケジューリング

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

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

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

両方のトリガー方法は非同期で、 `Promise<void>` を返し、条件がSDKに送信されると解決します。

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

{% tabs %}
{% tab title="React" %}

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

{% endtab %}
{% endtabs %}

しかし、評価のために複数の条件を一度にトリガーする方が便利な場合もあります。その場合は、任意の数の条件を含むオブジェクトを `triggers(conditions: Record<string, string>): Promise<void>` のメソッドシグネチャを使用します。

{% tabs %}
{% tab title="React" %}

```tsx
await PushSDK.AppMessages.triggers({
  enabled_subscription: "true",
  subscriber_tier: "premium"
});
```

{% endtab %}
{% endtabs %}

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

こちらの [SDK Callbacks](/pushly-ja/integration/implementation-steps/react-native/sdk-react-native/sdk-krubakku.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/react-native/sdk-react-native/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.
