Step 1: Integrate MoEngageRichNotification
If you require rich content or templates, integrate theMoEngageRichNotification library.
This step is mandatory if you have integrated the content extension mentioned in Step 2.
- Swift Package Manager (SPM)
- CocoaPods
To install the
MoEngageRichNotification through SPM, perform the following steps:- Navigate to File > Add Package.
- Enter the repository URL:
- SDK v9.23.0 and above:
https://github.com/moengage/apple-sdk.git - Earlier versions:
https://github.com/moengage/MoEngage-iOS-SDK.git
- SDK v9.23.0 and above:
- Select the master branch or a specific version and select Add Package.
- Target the package to your application.
Step 2: Integrate the extension integrator tool
Automate the extension configuration by adding a custom script to your build process.- In your application target, add a New Run Script Phase.
If you have already added a script phase and configured the input files, you can simply update the run command as described in Step 3.

- Add the following paths to the Input Files section:
$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)$(INSTALL_DIR)/$(INFOPLIST_PATH)

- Enter the command relevant to your dependency manager, replacing
$OPTIONSwith your desired configuration:
- Swift Packet Manager (SPM)
- CocoaPods
Swift Packet Manager (SPM)
Available options
Replace$OPTIONS with one or more of the following:
| Option | Description |
|---|---|
--enable-push-notification-templates | Required if the content extension from Step 2 is used. |
--notification-service-extension-name $CUSTOM_SERVICE_EXTENSION_NAME | Sets a custom name for the service extension. Use this when migrating to this tool from a custom service extension implementation. (Default: MoEngageNotificationService). |
--notification-content-extension-name $CUSTOM_CONTENT_EXTENSION_NAME | Sets a custom name for the content extension. Use this when migrating to this tool from a custom content extension implementation. (Default: MoEngageNotificationContent). |