> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# iOS プッシュの設定

> React Native アプリで、APNS 証明書と Entitlements を使用して iOS プッシュ通知を設定します。

## プッシュの設定

プッシュ通知を設定する方法は次の 2 つです。

### APNS 認証キー:

iOS ユーザーにプッシュ通知を送信するには、アプリケーション用の APNs Auth Key ファイルを生成し、MoEngage ダッシュボードにアップロードする必要があります。Auth Key の生成方法については、こちらの[リンク](https://www.moengage.com/docs/developer-guide/ios-sdk/push/basic/apns-authentication-key)を参照してください。

### APNS 証明書:

iOS でプッシュ通知を送信できるようにするには、まず APNS 証明書を作成してダッシュボードにアップロードする必要があります。以下の手順に従ってください。

* [APNS 証明書を作成する](https://www.moengage.com/docs/developer-guide/ios-sdk/push/basic/apns-certificate-pem-file-legacy#create-an-apns-certificate-in-developer-account)
* [作成した証明書を .pem 形式に変換する](https://www.moengage.com/docs/developer-guide/ios-sdk/push/basic/apns-certificate-pem-file-legacy#converting-certificate-to-pem-format)
* [.pem ファイルを MoEngage ダッシュボードにアップロードする](https://www.moengage.com/docs/developer-guide/ios-sdk/push/basic/apns-certificate-pem-file-legacy#uploading-pem-file-to-moengage-dashboard)

## プロジェクトへの Push Entitlement の追加:

APNS 証明書をアップロードしたら、Xcode プロジェクトで Push Entitlement を有効にします。アプリのターゲットを選択し、Capabilities に移動します。以下に示すように、アプリの Push Notifications 機能を有効にします。

![プッシュ通知の有効化 1](https://mintcdn.com/moengage/Jtvf10ggM77HdKvB/images/enable-push-notification-1.png?fit=max\&auto=format\&n=Jtvf10ggM77HdKvB\&q=85\&s=93b0a5b812e2bbe3cd5a4049725364d0)

## アンインストールのトラッキング:

アンインストールのトラッキングにはサイレントプッシュを使用します。すべてのユーザーのアンインストールをトラッキングするには、以下に示すように、アプリの Capabilities で Remote Notification のバックグラウンドモードを有効にします。

![アンインストールのトラッキング 1](https://mintcdn.com/moengage/bJi_ZHRHKldZCdcW/images/uninstall-tracking-1.png?fit=max\&auto=format\&n=bJi_ZHRHKldZCdcW\&q=85\&s=9bb879ff610a0f33fa76cd2b86c47700)

## プッシュの登録:

その後、以下に示すように、プラグインの **registerForPush** メソッドを使用してプッシュ通知を登録する必要があります。

```javascript JavaScript theme={null}
//This is only for iOS
import ReactMoE from 'react-native-moengage'
ReactMoE.registerForPush();
```

> [!WARNING]
>
> リモート通知関連のコールバックはすべてプラグインが受け取るため、AppDelegate ではそれらを受け取ることはできません。そのため、代わりにプラグインが提供する通知のオブザーバーを追加する必要があります。

## 仮のプッシュ登録（Provisional Push）:

> [!NOTE]
>
> * この機能は、プラグインのバージョン ***11.1.0*** からサポートされています。

仮のプッシュ通知（Provisional Push）を登録するには、以下に示すように、プラグインの ***registerForProvisionalPush*** API を呼び出します。

```javascript JavaScript theme={null}
import ReactMoE from 'react-native-moengage'

// This API is only for iOS

ReactMoE.registerForProvisionalPush();
```

## リッチプッシュとテンプレートのサポート:

React Native アプリでリッチプッシュ（通知内の画像/動画/音声）とテンプレートをサポートするには、iOS の Notification Service Extension と Content Extension を設定します。

* [サービス拡張機能とコンテンツ拡張機能を統合する](developer-guide/react-native-sdk/push/basic/integrating-moengage-service-and-content-extensions/set-up-ios-notification-extensions-for-rich-push-and-impression-tracking)

または、リッチプッシュとプッシュテンプレートを手動で統合することもできます。詳細については、以下のドキュメントを参照してください。

* [リッチプッシュ](https://www.moengage.com/docs/developer-guide/ios-sdk/push/basic/ios-push-integration-tutorial#optional)
* [プッシュテンプレート](https://www.moengage.com/docs/developer-guide/ios-sdk/push/optional/push-templates)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.