### 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 */}