### Set App Status to INSTALL
Source: https://www.moengage.com/docs/developer-guide/unity-sdk/data-tracking/install-update-differentiation
Call this API when the application is being installed for the first time by the user. This indicates a fresh installation.
```csharp
using MoEngage;
MoEngageClient.SetAppStatus(MoEAppStatus.INSTALL);
```
--------------------------------
### Example: Production Environment Integration
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
An example of the prefetch and initiation code for a production environment, with specific values for data center, SDK version, and workspace ID.
```html
```
--------------------------------
### Example Initialization with Placeholders Replaced
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
Example of the prefetch and initiation code after replacing 'workspace_id' and 'DC' with actual values. This includes preconnect and dns-prefetch links for optimal loading.
```JavaScript
```
--------------------------------
### Example: Test Environment Integration
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
An example of the complete code for integrating the web personalization module in a test environment, including debug logs.
```html
```
--------------------------------
### Contextual InApp Example in Activity
Source: https://www.moengage.com/docs/developer-guide/android-sdk/in-app-messages/in-app-nativ
Example demonstrating setting and resetting context for in-app messages within an Activity's lifecycle.
```kotlin
// Activity
class MyCustomActivity: Activity() {
override fun onStart() {
super.onStart()
MoEInAppHelper.getInstance().setInAppContext(setOf("context1", "context2"))
MoEInAppHelper.getInstance().showInApp(this)
}
override fun onStop() {
super.onStop()
MoEInAppHelper.getInstance().resetInAppContext()
}
}
// Fragment
class MyCustomFragment: Fragment() {
override fun onStart() {
super.onStart()
// Fragment's onStart code
// context1 and context2 can be changes as per screen/requirement
MoEInAppHelper.getInstance().setInAppContext(setOf("context1", "context2"))
MoEInAppHelper.getInstance().showInApp(this)
}
override fun onStop() {
super.onStop()
// Fragment's onStop code
MoEInAppHelper.getInstance().resetInAppContext()
}
}
```
--------------------------------
### Update Pods and Install
Source: https://www.moengage.com/docs/developer-guide/flutter-sdk/push/basic/integrating-moengage-service-and-content-extension-in-ios/migrating-to-the-extension-integrator-tool
After updating the pod repository, run `pod install` to integrate the RichNotification subspec into your project.
```bash
pod repo update
pod install
```
--------------------------------
### Set App Status to INSTALL
Source: https://www.moengage.com/docs/developer-guide/capacitor-sdk/data-tracking/install-update-differentiation
Call this API for a fresh installation of your app. Replace 'YOUR_WORKSPACE_ID' with your actual MoEngage Workspace ID.
```typescript
import { MoECapacitorCore, MoEAppStatus } from 'capacitor-moengage-core'
//For Fresh Install of App
MoECapacitorCore.setAppStatus({ appStatus: MoEAppStatus.INSTALL, appId: "YOUR_WORKSPACE_ID" });
```
--------------------------------
### Install MoEngage Web SDK using NPM
Source: https://www.moengage.com/docs/developer-guide/web-sdk/other-supported-web-sdk-integration/integrate-moengage-with-mcp-ui-apps
Install the MoEngage Web SDK package in your project directory using NPM. This is the first step in integrating the SDK.
```bash
npm install @moengage/web-sdk
```
--------------------------------
### Install CocoaPods
Source: https://www.moengage.com/docs/developer-guide/cordova-sdk/sdk-integration/sdk-installation/ios-installation
Execute this command in your terminal to install CocoaPods if you don't have it already.
```Ruby
sudo gem install cocoapods
```
--------------------------------
### Set App Status to Install (Flutter)
Source: https://www.moengage.com/docs/developer-guide/flutter-sdk/data-tracking/install-update-differentiation
Call this API when the application is being installed for the first time. Ensure the SDK is initialized before setting the app status.
```dart
import 'package:moengage_flutter/moengage_flutter.dart';
final MoEngageFlutter _moengagePlugin = MoEngageFlutter(YOUR_Workspace_ID);
_moengagePlugin.initialise();
_moengagePlugin.setAppStatus(MoEAppStatus.install);
```
--------------------------------
### Install MoEngage Capacitor Plugin
Source: https://www.moengage.com/docs/developer-guide/capacitor-sdk/sdk-integration/basic/sdk-installation/framework-dependency
Installs the capacitor-moengage-core plugin using npm. This is the first step in integrating MoEngage with a Capacitor project.
```shell
$npm install capacitor-moengage-core
```
--------------------------------
### Initialize MoEngage and Show Opt-in Prompt
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-push/configure-self-handled-opt-in
Basic integration example showing MoEngage initialization and calling the function to display the browser's native notification opt-in box. Ensure the SDK script is included.
```html
```
--------------------------------
### Example SPM Command for Extensions
Source: https://www.moengage.com/docs/developer-guide/flutter-sdk/push/basic/integrating-moengage-service-and-content-extension-in-ios/set-up-ios-notification-extensions-for-rich-push-and-impression-tracking
This example demonstrates a complete run script command for Swift Package Manager, specifying custom names for the notification service and content extensions, and enabling push notification templates.
```bash
${OBJROOT}/../../SourcePackages/artifacts/apple-sdk/moengage-extensions-integration/moengage-extensions-integration.artifactbundle/moengage-extensions-integration/bin/moengage-extensions-integration --enable-push-notification-templates --notification-service-extension-name NotificationService --notification-content-extension-name NotificationContent
```
--------------------------------
### Basic Custom Soft-Ask Implementation
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-push/configure-self-handled-opt-in
Example demonstrating how to initialize MoEngage and call `call_web_push` with custom soft-ask parameters. Includes the HTML structure for the soft-ask itself, with the main div initially hidden.
```html
...
{/* Your Custom Soft Ask Div */}
{/* Don't forget to set the style-display of your main_class to none */}
Recieve Notifications ?
...
YES
createState() => _CardsScreenState();
}
class _CardsScreenState extends State{
moe.MoEngageCards cards = moe.MoEngageCards("MOE_Workspace_ID");
@override
void initState() {
super.initState();
cards.initialize();
}
}
```
--------------------------------
### Track Install and Update Status
Source: https://www.moengage.com/docs/developer-guide/cordova-sdk/data-tracking/install-update-differentiation
Initialize the MoEngage Cordova SDK and then use the `setAppStatus` method to track either a fresh install or an app update. This is required for migration to the MoEngage Platform.
```javascript
var moe = MoECordova.init(YOUR_Workspace_ID);
// For fresh Install
moe.setAppStatus("INSTALL");
// For tracking App Update
moe.setAppStatus("UPDATE");
```
--------------------------------
### Install Glide Dependency for In-App Images
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/in-app-messages/inapp-nativ
Add this dependency to your android/app/build.gradle file to enable displaying images and GIFs in In-App messages starting from version 7.0.0.
```Groovy
dependencies {
...
implementation("com.github.bumptech.glide:glide:4.9.0")
}
```
--------------------------------
### Install react-native-moengage-cards
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/cards/installation/framework-dependency
Install the MoEngage Cards plugin using npm. Ensure the core react-native-moengage plugin is also installed.
```shell
$ npm install react-native-moengage-cards
```
--------------------------------
### Get Soft Ask Status
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-push/configure-self-handled-opt-in
Retrieves the current status of the soft ask prompt, which can be 'shown', 'allowed', or 'dismissed'.
```html
var softAskStatus = moeData.OPT_IN_SHOWN_TIME // it can be one of these: shown, allowed, dismissed
```
--------------------------------
### Install React Native MoEngage Geofence SDK
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/push/optional/location-triggered
Install the geofence SDK using npm. Ensure the base react-native-moengage plugin is also installed.
```bash
npm install react-native-moengage-geofence
```
--------------------------------
### Sample Objective-C SDK Initialization
Source: https://www.moengage.com/docs/developer-guide/cordova-sdk/sdk-integration/sdk-initialization/ios-sdk-initialization
This sample demonstrates how to initialize the MoEngage SDK within the application:didFinishLaunchingWithOptions: method in Objective-C. Ensure you import the necessary MoEngage header.
```objectivec
#import "AppDelegate.h"
#import "MainViewController.h"
// Make sure to import "AppDelegate+MoEngage.h"
#import "AppDelegate+MoEngage.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.viewController = [[MainViewController alloc] init];
MoEngageSDKConfig *sdkConfig = [[MoEngageSDKConfig alloc] initWithAppID: @"YOUR Workspace ID"];
sdkConfig.moeDataCenter = DATA_CENTER_01; // Possible Values DATA_CENTER_01/DATA_CENTER_02/ DATA_CENTER_03
sdkConfig.appGroupID = "App Group ID";
// ---
// Update other Parameters of SDK Config
[self initializeDefaultSDKConfig:sdkConfig andLaunchOptions:launchOptions];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
```
--------------------------------
### Web SDK Initialization Script
Source: https://www.moengage.com/docs/developer-guide/flutter-sdk/sdk-integration/sdk-initialization/web-sdk-initialization
Add this script to your `web/index.html` file. Ensure you replace placeholders for Data Center, Workspace ID, and SDK version.
```html
```
--------------------------------
### Install MoEngage React Native Package
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/sdk-integration/expo/installation
Install the core `react-native-moengage` package using npm.
```shell
npm install react-native-moengage
```
--------------------------------
### Initialize SDK via CDN
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration
For CDN integration, paste this initialization script directly into the `` tag of your HTML file. Ensure your Workspace ID and Data Center are correctly configured.
```javascript
```
--------------------------------
### Install Flutter Dependencies
Source: https://www.moengage.com/docs/developer-guide/flutter-sdk/sdk-integration/sdk-installation/framework-dependency
Run this command in your terminal after updating pubspec.yaml to install the added dependency.
```bash
flutter pub get
```
--------------------------------
### Install MoEngageCards via CocoaPods
Source: https://www.moengage.com/docs/developer-guide/ios-sdk/cards/self-handled-cards
Add the MoEngageCards framework dependency to your Podfile. Ensure you run `pod install` afterwards.
```Ruby
pod 'MoEngage-iOS-SDK/Cards',
```
--------------------------------
### Multiple Personalized Selectors Example
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
Example demonstrating how to define an array of HTML selectors for multiple personalized elements on a webpage.
```javascript
const personalizedSelectors = ['#homepage-title', '#homepage-subtitle', '#homepage-cta', '#homepage-cta-link', '#homepage-banner'];
```
--------------------------------
### Initialize Web SDK with Latest Version
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
Add this script to initiate the web personalization module when using the useLatest: true flag in NPM initialization config. Replace placeholders with your specific workspace ID and data center.
```JavaScript
```
--------------------------------
### Initialize MoEngage SDK using File-Based Initialization (iOS Swift)
Source: https://www.moengage.com/docs/developer-guide/capacitor-sdk/sdk-integration/basic/sdk-initialization/file-based-initlialization/migration-and-precedence
Migrate from manual MoEngageSDKConfig logic to reading configuration from Info.plist. Ensure all required MoEngage keys are present in the Info.plist file.
```swift
import MoEngageSDK
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) - Bool {
// ... existing code
MoECapacitorInitializer.sharedInstance.intializeDefaultInstance()
return true
}
```
--------------------------------
### Install MoEngage-iOS-SDK/InApps via CocoaPods
Source: https://www.moengage.com/docs/developer-guide/ios-sdk/in-app-messages/in-app-nativ
Integrate the MoEngageInApp framework by adding the dependency to your Podfile. Ensure you run 'pod install' afterwards.
```Ruby
pod 'MoEngage-iOS-SDK/InApps',
```
--------------------------------
### Initializing the Web SDK
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration
Initialize the MoEngage SDK with essential configurations like appId, environment, and logLevel. Ensure this is done on all pages before using SDK methods.
```javascript
moengage.initialize({
appId: 'XXXXXXXXXXXXXXXX',
env: 'LIVE',
logLevel: 0
});
```
--------------------------------
### Initialize SDK via NPM
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration
For NPM integration, use this import statement and initialization block in your main JavaScript file. Ensure your Workspace ID and Data Center are correctly configured.
```javascript
import moengage from '@moengage/web-sdk';
moengage.initialize({
// Replace YOUR_WORKSPACE_ID and YOUR_DATA_CENTER with your actual values
// For example, workspaceId: "YOUR_WORKSPACE_ID", dataCenter: "YOUR_DATA_CENTER"
// Refer to the documentation for a full list of configuration parameters.
});
```
--------------------------------
### Install Pods with Repository Update
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/sdk-integration/react-native/sdk-installation/ios
Run this command in your iOS directory after updating the Podfile to install dependencies and update local specs repositories.
```Bash
pod install --repo-update
```
--------------------------------
### Initiate Web Personalization Module (Production)
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
Include this script to initiate the web personalization module in a production environment. Ensure to replace placeholders for DC, sdkVersion, and workspace_id.
```html
```
--------------------------------
### Install MoEngage Expo Package
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/sdk-integration/expo/installation
Use `npx expo install` to add the MoEngage SDK package compatible with your Expo SDK version.
```shell
npx expo install react-native-expo-moengage
```
--------------------------------
### Install Capacitor Geofence Plugin
Source: https://www.moengage.com/docs/developer-guide/capacitor-sdk/push/optional/location-triggered
Install the capacitor-moengage-geofence plugin using npm. This is the initial step for integrating geofence functionality into your Capacitor project.
```shell
$npm install capacitor-moengage-geofence
```
--------------------------------
### Install Security SDK
Source: https://www.moengage.com/docs/developer-guide/android-sdk/sdk-integration/advanced-or-optional/installing-sdk-using-artifact-id
Integrate the Security module by adding its dependency to your app/build.gradle(.kts) file. Use the appropriate SDK version for $sdkVersion.
```gradle
dependencies {
...
implementation("com.moengage:security:$sdkVersion")
}
```
--------------------------------
### Install Push Amplification SDK
Source: https://www.moengage.com/docs/developer-guide/android-sdk/sdk-integration/advanced-or-optional/installing-sdk-using-artifact-id
Integrate the Push Amplification module by adding its dependency to your app/build.gradle(.kts) file. Use the appropriate SDK version for $sdkVersion.
```gradle
dependencies {
...
implementation("com.moengage:push-amp:$sdkVersion")
}
```
--------------------------------
### Get Unclicked Card Count (Synchronous)
Source: https://www.moengage.com/docs/developer-guide/android-sdk/cards/cards
Call this API on a worker thread as it reads from a file to get the number of cards that have not been clicked by the user.
```kotlin
// Call this API on worker thread as it reads from a file.
MoECardHelper.getUnClickedCardCount(context)
```
--------------------------------
### Install Core SDK
Source: https://www.moengage.com/docs/developer-guide/android-sdk/sdk-integration/advanced-or-optional/installing-sdk-using-artifact-id
Add the core MoEngage SDK dependency to your app/build.gradle(.kts) file. Replace $sdkVersion with the appropriate SDK version.
```gradle
dependencies {
...
implementation("com.moengage:moe-android-sdk:$sdkVersion")
}
```
--------------------------------
### Install Firebase CLI
Source: https://www.moengage.com/docs/developer-guide/components-for-sdk/tracking/real-time-uninstall-tracking
Install the Firebase Command Line Interface globally using npm. This tool is necessary for deploying functions to the Cloud Functions runtime.
```bash
npm install -g firebase-tools
```
--------------------------------
### Deprecated Objective-C Initialization Methods
Source: https://www.moengage.com/docs/developer-guide/ios-sdk/migration/migration-to-sdk-version-6-0-0
These methods for initializing the SDK in TEST and LIVE environments are deprecated and will be removed in SDK version 7.0.0. Use the newer `initializeDevWithAppID:withLaunchOptions:` and `initializeProdWithAppID:withLaunchOptions:` methods instead.
```Objective-C
/**
For TEST Environment
@warning This method is deprecated and will be removed from SDK Version 7.0.0. Use initializeDevWithAppID:withLaunchOptions instead
*/
-(void)initializeDevWithApiKey:(NSString *_Nonnull)apiKey inApplication:(UIApplication *_Nullable)application withLaunchOptions:(NSDictionary *_Nullable)launchOptions openDeeplinkUrlAutomatically:(BOOL)openUrl __deprecated_msg("Use initializeDevWithAppID:withLaunchOptions instead.");
/**
For LIVE Environment
@warning This method is deprecated and will be removed from SDK Version 7.0.0. Use initializeProdWithAppID:withLaunchOptions: instead
*/
-(void)initializeProdWithApiKey:(NSString *_Nonnull)apiKey inApplication:(UIApplication *_Nullable)application withLaunchOptions:(NSDictionary *_Nullable)launchOptions openDeeplinkUrlAutomatically:(BOOL)openUrl __deprecated_msg("Use initializeProdWithAppID:withLaunchOptions: instead.");
```
--------------------------------
### Initialize MoEngage SDK
Source: https://www.moengage.com/docs/developer-guide/android-sdk/sdk-integration/basic-integration/sdk-initialization
Initialize the MoEngage SDK with your Workspace ID and Data Center. This should be done in the Application class's onCreate() method on the main thread.
```kotlin
import com.moengage.core.DataCenter
import com.moengage.core.MoEngage
val moEngage = MoEngage.Builder(this, "YOUR_Workspace_ID", DataCenter.DATA_CENTER_X)
.build()
//replace X with your data center number
MoEngage.initialiseDefaultInstance(moEngage)
```
--------------------------------
### Initializing Web SDK with Latest Version
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration
Initialize the MoEngage SDK, forcing the use of the latest version by setting `useLatest` to true. This bypasses the version specified in your package manager.
```javascript
moengage.initialize({appId: 'XXXXXXXXXXXXXXXX', useLatest: true});
```
--------------------------------
### Get New Cards Count
Source: https://www.moengage.com/docs/developer-guide/flutter-sdk/cards/self-handled-cards
Retrieves the count of new cards available for the user. This method should be called to get an updated count of unread or new cards.
```APIDOC
## Get New Cards Count
### Description
Retrieves the count of new cards available for the user.
### Method Signature
`Future getNewCardsCount()`
### Parameters
None
### Returns
An integer representing the count of new cards.
```
--------------------------------
### Initialize SDK with Cards Config
Source: https://www.moengage.com/docs/developer-guide/web-sdk/cards/self-handled-cards
Enable the cards module by passing the cards configuration during SDK initialization. This ensures the cards functionality is available.
```javascript
Moengage = moe({
appId: moeAppID,
env: 'LIVE',
logLevel: 0,
cards: {
enable: true
}
});
```
--------------------------------
### Get New Card Count (Synchronous)
Source: https://www.moengage.com/docs/developer-guide/android-sdk/cards/cards
Call this API on a worker thread as it reads from a file to get the count of new cards available for the user on the device.
```kotlin
// Call this API on worker thread as it reads from a file.
MoECardHelper.getNewCardCount(context)
```
--------------------------------
### Basic Web SDK Integration
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration
Insert this script into the `` tag of your pages. Replace placeholders for Data Center, App ID, and SDK version. Ensure the Data Center value is valid.
```html
```
--------------------------------
### Start Broadcast Live Activity Locally
Source: https://www.moengage.com/docs/developer-guide/ios-sdk/push/optional/broadcast-live-activity
Initiates a Live Activity from within the app, triggered by user action. It combines application-specific attributes with MoEngage metadata and uses Apple's Activity.request() to start the Live Activity, linking it to a campaign. Ensure to track the 'Live Activity Started' event using trackStarted(activity:).
```swift
import MoEngageLiveActivity
guard #available(iOS 18, *) else { return }
guard let result = await MoEngageSDKLiveActivity.createAttributes(
withCampaign: MoEngageSDKLiveActivity.Campaign(
campaignId: "Your Campaign Id", campaignName: "Your Campaign Name",
deliveryType: "Broadcast Live Activity",
attributeType: "\(FootballActivityAttributes.self)",
instanceId: "Your Instance Id",
appAttributes: FootballActivityAttributes(team1Name: "Chiefs", team2Name: "Bills"),
appContent: FootballActivityAttributes.ContentState(teamOneScore: 0, teamTwoScore: 0)
)
) else { return }
do {
let activity = try MoEngageActivity.request(
attributes: result.attributes,
content: .init(
state: result.content, staleDate: .distantFuture,
relevanceScore: 10
),
pushType: .channel("Your channel Id"), style: .standard
)
// Track started event
MoEngageSDKLiveActivity.trackStarted(activity: activity)
} catch {
// log error
}
```
--------------------------------
### Initialize MoEngage Web SDK with Custom Proxy Domain
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/advanced-integration/custom-proxy-domain-web
Replace the standard MoEngage SDK initialization script with this snippet. Ensure you define your data center, workspace ID, and custom proxy domain. This script dynamically sets the scriptHost to load the SDK from your proxied CDN.
```javascript
```
--------------------------------
### Set App Status to Install or Update
Source: https://www.moengage.com/docs/developer-guide/ios-sdk/data-tracking/basic/install-update-differentiation
Use these methods to inform the MoEngage SDK whether the app is a fresh install or an update. This is essential for accurate user tracking.
```swift
//For Fresh Install of App
MoEngageSDKAnalytics.sharedInstance.appStatus(.install)
// For Existing user who has updated the app
MoEngageSDKAnalytics.sharedInstance.appStatus(.update)
```
--------------------------------
### Initiate Web Personalization Module (Test Environment)
Source: https://www.moengage.com/docs/developer-guide/personalize-sdk/sdk-integration/web-personalization-v2
Add `debug_logs=1` to the script source to track data in the test environment. Replace placeholders for DC, sdkVersion, and workspace_id.
```html
```
--------------------------------
### Initializing the Web SDK with Project ID
Source: https://www.moengage.com/docs/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration
Initialize the MoEngage SDK, including the projectId for specialized projects or if Portfolio is enabled.
```javascript
moengage.initialize({
appId: 'XXXXXXXXXXXXXXXX',
projectId: 'your_projectId',
env: 'LIVE',
logLevel: 0
});
```
--------------------------------
### Install React Native MoEngage SDK
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/sdk-integration/react-native/sdk-installation/framework-dependency
Install the MoEngage React Native SDK using npm. This command is essential for integrating MoEngage analytics into your React Native application.
```shell
$ npm install react-native-moengage
```
--------------------------------
### Install PushAmpPlus SDK
Source: https://www.moengage.com/docs/developer-guide/android-sdk/sdk-integration/advanced-or-optional/installing-sdk-using-artifact-id
Add the PushAmpPlus module dependency to your app/build.gradle(.kts) file. Replace $sdkVersion with the correct SDK version.
```gradle
dependencies {
...
implementation("com.moengage:push-amp-plus:$sdkVersion")
}
```
--------------------------------
### Track App Install or Update with React Native SDK
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/data-tracking/install-update
Use `setAppStatus()` to distinguish between a fresh app installation and an update from an existing version. Import `ReactMoE` and `MoEAppStatus` for this functionality.
```javascript
import ReactMoE,
{
MoEAppStatus,
} from "react-native-moengage";
//For Fresh Install of App
ReactMoE.setAppStatus(MoEAppStatus.Install);
// For Existing user who has updated the app
ReactMoE.setAppStatus(MoEAppStatus.Update);
```
--------------------------------
### Install MoEngage Personalization via CocoaPods
Source: https://www.moengage.com/docs/developer-guide/ios-sdk/personalize/personalize-sdk
Add the MoEngage-iOS-SDK/Personalization pod to your Podfile and run pod install. CocoaPods is being deprecated; Swift Package Manager is recommended for new integrations.
```ruby
pod 'MoEngage-iOS-SDK/Personalization'
```
--------------------------------
### Update iOS Initialization API for Default Instance
Source: https://www.moengage.com/docs/developer-guide/release-notes/react-native-sdk/changelog-5
Demonstrates the updated iOS initialization API for the default instance, using launch options.
```objective-c
- (void)intializeSDKWithLaunchOptions:(NSDictionary*)launchOptions;
```
```objective-c
- (void)initializeDefaultInstance:(NSDictionary*)launchOptions;
```
--------------------------------
### Example Self-Handled OSM Campaign Data Payload
Source: https://www.moengage.com/docs/developer-guide/web-sdk/onsite-messaging/self-handled-on-site-messaging
This is an example of the `fullCampaignData` object structure received by the callback function. It contains all necessary information for rendering a custom on-site message.
```javascript
[{
"campaignId": "000000000000000000000001",
"campaignName": "Holiday Sale Banner",
"expiryTime": "2025-12-31T23:59:59.000Z",
"updatedTime": "2025-10-06T10:30:00.000Z",
"status": "ACTIVE",
"jsonPayload": "{\"title\":\"Holiday Sale!\",\"message\":\"Get up to 50% off all items.\"}",
"dismissInterval": 86400,
"context": {
"campaign_name": "Holiday Sale Banner",
"cid": "000000000000000000000001_v2",
"moe_locale_id": "eng-us",
"moe_locale_name": "English (US)",
"moe_variation_id": "variation_b_12345"
},
"urlFilters": null
}]
```
--------------------------------
### Install React Native MoEngage Inbox
Source: https://www.moengage.com/docs/developer-guide/react-native-sdk/push/optional/notification-triggered
Install the MoEngage Inbox plugin using npm. This command also handles linking native dependencies for older React Native versions.
```shell
$ npm install react-native-moengage-inbox
# required only if you are using versions that do not support auto linking
# This command is removed in version 0.69 of react-native
$ react-native link react-native-moengage-inbox
```