Listen for and handle in-app popup events with the Notifly SDK.
The Notifly SDK provides an event listener for in-app popups. Use the listener to run additional actions in your app when a user interacts with a popup.
Android
iOS
Flutter
React Native
This feature requires Notifly Android SDK 1.16.1 or later.
package com.your.project import android.app.Application import android.util.Log import androidx.core.app.NotificationCompat import androidx.core.content.ContextCompat import tech.notifly.Notifly import tech.notifly.push.interfaces.IInAppMessageEventListener class SampleApplication : Application() { override fun onCreate() { super.onCreate() // Initialize Notifly SDK Notifly.initialize( context = applicationContext, projectId = BuildConfig.NOTIFLY_PROJECT_ID, username = BuildConfig.NOTIFLY_USERNAME, // password is a placeholder for backward compatibility. Do not use a real password or API Secret Key. password = BuildConfig.NOTIFLY_USERNAME, ) // Add Notifly in-app message event listener Notifly.addInAppMessageEventListener( object : IInAppMessageEventListener { override fun handleEvent( eventName: String, eventParams: Map<String, Any?>?, ) { Log.d("SampleApplication", "InAppMessage event dispatched: $eventName, $eventParams") } }, ) } }
This feature requires Notifly iOS SDK 1.16.1 or later.
import Firebaseimport notifly_sdkimport UIKitimport UserNotifications@mainclass AppDelegate: UIResponder, UIApplicationDelegate { func application( _: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { ... Notifly.initialize( projectId: TestConstant.projectId, username: TestConstant.username, // password is a placeholder for backward compatibility. Do not use a real password or API Secret Key. password: TestConstant.username) Notifly.addInAppMessageEventListener { eventName, eventParams in print("In App Message Event: \(eventName)") if let params = eventParams { print("In App Message Event Params: \(params)") } } ... return true }}
This feature requires Notifly Flutter SDK 2.1.0 or later. The event stream is available on Android and iOS. Web is not supported.
import 'package:flutter/material.dart';import 'package:notifly_flutter/notifly_flutter.dart';import 'dart:async';class MyApp extends StatefulWidget { const MyApp({super.key}); @override State<MyApp> createState() => _MyAppState();}class _MyAppState extends State<MyApp> { StreamSubscription<InAppMessageEvent>? _subscription; @override void initState() { super.initState(); _initNotifly(); } Future<void> _initNotifly() async { // Initialize Notifly SDK await NotiflyPlugin.initialize( projectId: 'YOUR_PROJECT_ID', username: 'YOUR_USERNAME', // `password` is a placeholder for backward compatibility. Do not use a real password or API Secret Key. password: 'YOUR_USERNAME', ); // Subscribe to in-app message events _subscription = NotiflyPlugin.inAppEvents.listen( (event) { print('InAppMessage event dispatched: ${event.eventName}'); print('Event params: ${event.eventParams}'); // Handle specific events switch (event.eventName) { case 'main_button_click': // Handle main button click break; case 'close_button_click': // Handle close button click break; } }, onError: (error, stackTrace) { print('InAppMessage event error: $error'); print('Stack trace: $stackTrace'); }, cancelOnError: false, // Continue listening even after an error ); } @override void dispose() { _subscription?.cancel(); super.dispose(); } @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar(title: const Text('Notifly Sample')), body: const Center(child: Text('Notifly Initialized')), ), ); }}
This feature requires Notifly React Native SDK 4.6.0 or later and is available on Android and iOS.
Initialize the SDK, then register an in-app popup event listener as shown below.
import notifly from 'notifly-sdk';export async function initNotifly() { await notifly.initialize({ projectId: 'YOUR_PROJECT_ID', username: 'YOUR_USERNAME', // `password` is a backward-compatibility placeholder. Do not enter a real password or API Secret Key. password: 'YOUR_USERNAME', }); const subscription = notifly.addInAppMessageEventListener((event) => { console.log('InAppMessage event dispatched:', event.eventName); }); return subscription;}
In your app initialization code, keep the subscription returned by await initNotifly(). Call subscription.remove() when you no longer need to receive events. Register before triggering a popup; events that occurred before registration are not replayed.
In-app popup event listener interface
Android
iOS
Flutter
React Native
Implement the handleEvent method of IInAppMessageEventListener to listen for in-app popup events. The method receives the following parameters:
String
The name of the event.
Map<String, Any?>?
Additional information about the event, or null if no parameters are provided.
Register an InAppMessageEventListener with addInAppMessageEventListener.
String
The name of the event.
[String: Any]?
Additional information about the event, or nil if no parameters are provided.
Subscribe to in-app popup events through the NotiflyPlugin.inAppEvents stream. Each event is an InAppMessageEvent object with the following properties:
String
The name of the event.
Map<String, dynamic>?
Additional information about the event, or null if no parameters are provided.
Subscribe to in-app popup events with notifly.addInAppMessageEventListener. Each event is an InAppMessageEvent object with the following properties:
string
The name of the event.
Record<string, unknown> | null
Additional information about the event. Values depend on the event and platform, and are null if no parameters are provided.
In-app popup events
Android
iOS
Flutter
React Native
The following eventName values are passed to handleEvent.
in_app_message_show: The in-app popup is displayed.
main_button_click: The user taps the main button in the popup.
hide_in_app_message_button_click: The user taps the Do Not Show Again button.
close_button_click: The user taps the close button in the popup.
survey_submit_button_click: The user taps the survey submit button.
The following eventName values are passed to addInAppMessageEventListener.
in_app_message_show: The in-app popup is displayed.
main_button_click: The user taps the main button in the popup.
hide_in_app_message_button_click: The user taps the Do Not Show Again button.
close_button_click: The user taps the close button in the popup.
survey_submit_button_click: The user taps the survey submit button.
The following eventName values are passed through NotiflyPlugin.inAppEvents.
in_app_message_show: The in-app popup is displayed.
main_button_click: The user taps the main button in the popup.
hide_in_app_message_button_click: The user taps the Do Not Show Again button.
close_button_click: The user taps the close button in the popup.
survey_submit_button_click: The user taps the survey submit button.
The following eventName values are passed to notifly.addInAppMessageEventListener.
in_app_message_show: An in-app popup display event.
main_button_click: The user taps the main button in the popup.
hide_in_app_message_button_click: The user taps the Do Not Show Again button.
close_button_click: The user taps the close button in the popup.
survey_submit_button_click: The user taps the survey submit button.
Android SDK 1.24.3, included in React Native SDK 4.6.0, has an existing issue: survey_submit_button_click is not delivered if the survey extra_data has no link field. iOS delivers the event under the same condition.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Notifly Docs","colors":{"primary":"#0144CD","light":"#3F7BFF"},"logo":{"light":"https://mintcdn.com/notifly/rl-cEZ-semfYDKMK/images/notifly.png?fit=max\u0026auto=format\u0026n=rl-cEZ-semfYDKMK\u0026q=85\u0026s=1fd87113cc3e1e0462340d5e153b1152","dark":"https://mintcdn.com/notifly/rl-cEZ-semfYDKMK/images/notifly.png?fit=max\u0026auto=format\u0026n=rl-cEZ-semfYDKMK\u0026q=85\u0026s=1fd87113cc3e1e0462340d5e153b1152"},"favicon":"https://mintcdn.com/notifly/rl-cEZ-semfYDKMK/favicon.ico?fit=max\u0026auto=format\u0026n=rl-cEZ-semfYDKMK\u0026q=85\u0026s=2161f91102cfa81441a33f4bb6cbc931","appearance":{"default":"light","strict":true},"seo":{"metatags":{"canonical":"https://docs.notifly.tech","author":"Notifly","og:locale":"ko_KR","keywords":"노티플라이, Notifly, push notification, 푸시 알림, 인앱 팝업, in-app message, 마케팅 자동화, marketing automation, 유저 참여, user engagement, 모바일 SDK, mobile SDK, web push, 웹 푸시, 카카오톡, 이메일, SMS, campaign, 캠페인, user journey, 유저 여정, personalization, 개인화, analytics, 분석, Firebase, Android SDK, iOS SDK, React Native, Flutter, JavaScript SDK, GTM, API"},"paths":[{"path":"en","metatags":{"og:locale":"en_US"}},{"path":"ja","metatags":{"og:locale":"ja_JP"}}]},"integrations":{"ga4":{"measurementId":"G-LBWM5EWR3L"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"thumbnails":{"fonts":{"family":"Pretendard JP","source":"fonts/PretendardJP-SemiBold.woff","format":"woff"}},"styling":{"latex":false},"navigation":{"languages":[{"language":"ko","default":true,"href":"ko"},{"language":"en","href":"en"},{"language":"ja","href":"ja"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"notifly","hasAudioNarration":false,"actualSubdomain":"notifly","customDomains":["docs.notifly.tech"],"gitSource":{"type":"github","owner":"team-michael","repo":"notifly-event","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6b00432041fcdaa6a1cc79a6","clientVersion":"0.0.4248","searchFilterCounts":[{"language":"ko","tag":"User Guides","count":62},{"language":"en","tag":"User Guides","count":59},{"language":"ja","tag":"ユーザーガイド","count":59},{"language":"en","tag":"API Reference","count":50},{"language":"ko","tag":"API Reference","count":50},{"language":"ja","tag":"APIリファレンス","count":50},{"language":"en","tag":"Developer Guides","count":24},{"language":"ja","tag":"開発者ガイド","count":24},{"language":"ko","tag":"Developer Guides","count":23},{"language":"en","tag":"Catalogs","count":18},{"language":"ko","tag":"카탈로그","count":18},{"language":"ja","tag":"カタログ","count":18},{"language":"en","tag":"SDK integration","count":17},{"language":"ko","tag":"개발자 가이드","count":17},{"language":"ja","tag":"SDK連携","count":17},{"language":"ko","tag":"채널","count":16},{"language":"en","tag":"Mobile SDKs","count":13},{"language":"en","tag":"User Journeys","count":13},{"language":"en","tag":"Messaging management","count":13},{"language":"ko","tag":"모바일 SDK","count":13},{"language":"ko","tag":"캠페인","count":13},{"language":"ko","tag":"유저 여정","count":13},{"language":"ko","tag":"메시징 관리","count":13},{"language":"ja","tag":"モバイルSDK","count":13},{"language":"ja","tag":"ユーザージャーニー","count":13},{"language":"ja","tag":"メッセージ配信の管理","count":13},{"language":"en","tag":"Channels","count":12},{"language":"en","tag":"Integrations","count":12},{"language":"ja","tag":"チャネル","count":12},{"language":"ja","tag":"外部連携","count":12}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"public/style.css","content":"@import url(\"https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css\");:root{--notifly-primary: #0144cd;--notifly-primary-600: #0144cd;--notifly-primary-700: #003bb5;--notifly-primary-100: #e8f0ff;--notifly-ink: #0b1220;--notifly-muted: #5a6473;--notifly-border: #e6e8ec;--mint-color-primary: var(--notifly-primary);--mint-color-primary-contrast: #ffffff;--mint-color-fg: var(--notifly-ink);--mint-color-muted: var(--notifly-muted);--mint-border-color: var(--notifly-border);--notifly-h1: 2rem;--notifly-h2: 1.5rem;--notifly-h3: 1.25rem;--notifly-body: 1rem;--notifly-small: 0.9375rem}html,body{font-family:\"Pretendard Variable\", Pretendard, -apple-system, BlinkMacSystemFont,\n \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Apple SD Gothic Neo\",\n \"Noto Sans KR\", \"Malgun Gothic\", \"Apple Color Emoji\", \"Segoe UI Emoji\",\n \"Segoe UI Symbol\", sans-serif!important;color:var(--notifly-ink);font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mdx-content h1,.page-title{font-size:var(--notifly-h1);font-weight:700;letter-spacing:-0.01em}.mdx-content h2{font-size:var(--notifly-h2);font-weight:700;letter-spacing:-0.01em}.mdx-content h3{font-size:var(--notifly-h3);font-weight:600}a,.link{color:var(--notifly-primary);text-underline-offset:2px}a:hover,.link:hover{color:var(--notifly-primary-700)}.topbar-cta-button,.topbar-cta-button a,button.tryit-button,.navbar .button-primary,.button-primary{background:var(--notifly-primary)!important;color:#fff!important;border:1px solid var(--notifly-primary)!important;box-shadow:none!important}.topbar-cta-button:hover,button.tryit-button:hover,.navbar .button-primary:hover,.button-primary:hover{background:var(--notifly-primary-700)!important;border-color:var(--notifly-primary-700)!important}.nav-tabs,.tabs,.TabsBar,.nav-tabs-item{--tab-active: var(--notifly-primary)}.nav-tabs-item[aria-selected=\"true\"],.tabs [aria-selected=\"true\"]{color:var(--notifly-primary);border-bottom-color:var(--notifly-primary)}@media (min-width: 1024px){#sidebar{width:19rem}}.sidebar,.Sidebar,.sidebar-content{font-family:inherit}.sidebar-group-header,.SidebarGroupHeader{font-weight:700}.sidebar a,.sidebar .link,.Sidebar a{color:var(--notifly-ink)}.sidebar a:hover,.Sidebar a:hover{color:var(--notifly-primary)}.sidebar-title,.SidebarTitle{color:var(--notifly-muted);text-transform:uppercase;font-size:0.8rem;letter-spacing:.06em}.sidebar-group-icon{color:var(--notifly-primary)}.eyebrow,.Eyebrow{color:var(--notifly-muted)}code,pre code,.code-block,.CodeBlock{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace!important}.code-block,.CodeBlock{border:1px solid var(--notifly-border)}code{background:#f6f8fa;border-radius:6px;padding:0.1rem 0.3rem}.method-pill,.MethodPill,.method-nav-pill,.MethodNavPill,.nav-tag-pill,.NavTagPill{text-align:center;color:var(--notifly-primary);font-weight:600}.api-playground-input,.APIPlaygroundInput,.RequestExample,.request-example,.ResponseExample,.response-example,.panel,.Panel{border-color:var(--notifly-border)!important}.api-playground-input:focus-within,.search-input:focus,.field:focus-within{outline:2px solid var(--notifly-primary);outline-offset:2px}.search-input,.SearchInput{border:1px solid var(--notifly-border)}.search-input:focus{border-color:var(--notifly-primary)}.callout,.Callout{border-left:4px solid var(--notifly-primary);background:#f8fbff}.table-of-contents a,.toc a,.TableOfContents a{color:var(--notifly-ink)}.table-of-contents a:hover,.toc a:hover,.TableOfContents a:hover{color:var(--notifly-primary)}.pagination-title,.PaginationTitle{color:var(--notifly-primary)}::selection{background:rgba(1, 68, 205, 0.18)}.footer,.Footer{border-top:1px solid var(--notifly-border)}@import url(\"https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/variable/pretendardvariable.css\");.doccards-gray a.card{background-color:#FFFFFF!important;border-color:#B6BBC1!important;color:#000000!important;border-radius:1.25rem;box-shadow:none!important;transition:transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;font-family:\"Pretendard Variable\", Pretendard, -apple-system, BlinkMacSystemFont,\n \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Apple SD Gothic Neo\",\n \"Noto Sans KR\", sans-serif!important}.doccards-gray a.card:hover,.doccards-gray a.card:focus-visible{background-color:#FFFFFF!important;border-color:#000000!important;transform:translateY(-3px);box-shadow:0 8px 18px rgba(1, 68, 205, .35);outline:none}.doccards-gray a.card [data-component-part=\"card-title\"]{color:#000000!important;font-weight:700!important;font-size:17px!important}.doccards-gray a.card [data-component-part=\"card-content\"],.doccards-gray a.card [data-component-part=\"card-content\"] *{color:#727272!important;font-size:14px!important}.doccards-gray a.card [data-component-part=\"card-icon\"]{color:#727272!important;fill:#727272!important}.doccards-gray a.card [data-component-part=\"card-icon\"]>svg{background-color:#727272!important}.doccards-gray a.card #card-link-arrow-icon{color:#000000!important}.doccards-gray a.card:hover #card-link-arrow-icon{color:#000000!important}.mdx-content table{width:100%;border-collapse:collapse;margin:1.5rem 0;table-layout:fixed;border-radius:10px!important;font-family:\"Pretendard Variable\", Pretendard, -apple-system, BlinkMacSystemFont,\n \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Apple SD Gothic Neo\",\n \"Noto Sans KR\", sans-serif;font-size:0.95rem;line-height:1.6;border:1px solid #DFE0E4}.mdx-content th{background-color:#F6F6F7;color:#000000;font-weight:600;text-align:left;padding:14px 18px;border:1px solid #DFE0E4}.mdx-content td{background-color:#ffffff;color:#1b1f23;padding:12px 18px;border:1px solid #DFE0E4;vertical-align:middle}.mdx-content thead,.mdx-content tbody{display:table;width:100%;table-layout:fixed}.mdx-content thead tr,.mdx-content tbody tr{display:table-row;width:100%}.mdx-content td:first-child,.mdx-content th:first-child{text-align:left;font-weight:500}.mdx-content tr:nth-child(even) td{background-color:#f9fafc}.mdx-content tr:hover td{background-color:#eff6ff}@media (max-width: 768px){.mdx-content table{font-size:0.9rem}.mdx-content th,.mdx-content td{padding:8px 10px}}.steps .step [data-component-part=\"step-number\"] .size-7{background-color:var(--notifly-primary-600)!important;color:var(--mint-color-primary-contrast)!important}.steps .step>.absolute.w-px{background-color:var(--notifly-primary-600)!important;opacity:1!important}.steps .step:last-of-type>.absolute.w-px{display:none}.steps .step:hover [data-component-part=\"step-number\"] .size-7{background-color:var(--notifly-primary-700)!important}.eyebrow{color:var(--notifly-primary-600)!important}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){border-inline-start-color:var(--notifly-primary-600)}"}]}
{"page":{"pagePath":"en/advanced/inapp-popup-event-listener","slug":"/en/advanced/inapp-popup-event-listener","pageMetadata":{"title":"In-app popup event listener","description":"Listen for and handle in-app popup events with the Notifly SDK.","href":"/en/advanced/inapp-popup-event-listener"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Listen for and handle in-app popup events with the Notifly SDK.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Info,Note,ParamField,Tab,Tabs}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Info)_missingMdxReference(`Info`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Tab)_missingMdxReference(`Tab`,true);if(!Tabs)_missingMdxReference(`Tabs`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`The Notifly SDK provides an event listener for in-app popups. Use the listener to run additional actions in your app when a user interacts with a popup.`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Android`,id:`android`,children:[_jsx(Info,{children:_jsx(_components.p,{children:`This feature requires Notifly Android SDK 1.16.1 or later.`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`35`,language:`kotlin`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`kotlin`,children:_jsxs(_components.code,{language:`kotlin`,numberOfLines:`35`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` package`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` com.your.project`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` android.app.Application`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` android.util.Log`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` androidx.core.app.NotificationCompat`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` androidx.core.content.ContextCompat`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` tech.notifly.Notifly`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#D4D4D4`},children:` tech.notifly.push.interfaces.IInAppMessageEventListener`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` SampleApplication`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` : `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Application`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` override`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` fun`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` onCreate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` super`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`onCreate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`()`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Initialize Notifly SDK`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Notifly.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initialize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` context `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` applicationContext,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` projectId `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` BuildConfig.NOTIFLY_PROJECT_ID,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` username `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` BuildConfig.NOTIFLY_USERNAME,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // password is a placeholder for backward compatibility. Do not use a real password or API Secret Key.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` password `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` BuildConfig.NOTIFLY_USERNAME,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Add Notifly in-app message event listener`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Notifly.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addInAppMessageEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` object`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` : `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`IInAppMessageEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` override`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` fun`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` handleEvent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` eventName: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`String`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` eventParams: `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Map`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`String`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`Any`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`?>?,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ) {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Log.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`d`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"SampleApplication\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"InAppMessage event dispatched: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`$eventName`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`$eventParams`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`]})})})]}),_jsxs(Tab,{title:`iOS`,id:`ios`,children:[_jsx(Info,{children:_jsx(_components.p,{children:`This feature requires Notifly iOS SDK 1.16.1 or later.`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`27`,language:`swift`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`swift`,children:_jsxs(_components.code,{language:`swift`,numberOfLines:`27`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` Firebase`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` notifly_sdk`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UIKit`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` UserNotifications`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`@main`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` AppDelegate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`UIResponder`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`UIApplicationDelegate `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` func`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` application`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` _`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: UIApplication,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` didFinishLaunchingWithOptions`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` _`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [UIApplication.LaunchOptionsKey: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`Any`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`->`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Bool`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Notifly.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`initialize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: TestConstant.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`projectId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`username`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: TestConstant.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`username`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // password is a placeholder for backward compatibility. Do not use a real password or API Secret Key.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` password`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: TestConstant.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`username`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` Notifly.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`addInAppMessageEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { eventName, eventParams `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"In App Message Event: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`eventName`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` if`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` let`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` params `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` eventParams {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"In App Message Event Params: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`\\\\(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#D4D4D4`},children:`params`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`)`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` ...`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` true`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),_jsxs(Tab,{title:`Flutter`,id:`flutter`,children:[_jsx(Info,{children:_jsx(_components.p,{children:`This feature requires Notifly Flutter SDK 2.1.0 or later. The event stream is available on Android and iOS. Web is not supported.`})}),_jsx(CodeBlock,{filename:``,numberOfLines:`69`,language:`dart`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`dart`,children:_jsxs(_components.code,{language:`dart`,numberOfLines:`69`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'package:flutter/material.dart'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'package:notifly_flutter/notifly_flutter.dart'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'dart:async'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` MyApp`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` StatefulWidget`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` MyApp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`super`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.key});`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` @override`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` State`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`MyApp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`createState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=>`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` _MyAppState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`class`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` _MyAppState`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` extends`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` State`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`MyApp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` StreamSubscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`InAppMessageEvent`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` _subscription;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` @override`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` initState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` super`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initState`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` _initNotifly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Future`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`void`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`> `}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`_initNotifly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`async`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Initialize Notifly SDK`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` NotiflyPlugin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initialize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` projectId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_PROJECT_ID'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` username`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_USERNAME'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" // `password` is a placeholder for backward compatibility. Do not use a real password or API Secret Key.\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` password`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_USERNAME'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Subscribe to in-app message events`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` _subscription `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` NotiflyPlugin`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.inAppEvents.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`listen`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (event) {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'InAppMessage event dispatched: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`eventName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Event params: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:\"${\"}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`eventParams`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle specific events`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` switch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (event.eventName) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'main_button_click'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle main button click`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` case`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'close_button_click'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // Handle close button click`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` break`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onError`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (error, stackTrace) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'InAppMessage event error: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`error`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Stack trace: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`$`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#9CDCFE`},children:`stackTrace`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` cancelOnError`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Continue listening even after an error`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` @override`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` void`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` dispose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` _subscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`?`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`cancel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` super`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`dispose`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` @override`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Widget`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` build`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`BuildContext`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` context) {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` MaterialApp`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` home`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Scaffold`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` appBar`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` AppBar`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(title`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Notifly Sample'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)),`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` body`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Center`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(child`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:` Text`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Notifly Initialized'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)),`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` );`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),_jsxs(Tab,{title:`React Native`,id:`react-native`,children:[_jsx(Info,{children:_jsx(_components.p,{children:`This feature requires Notifly React Native SDK 4.6.0 or later and is available on Android and iOS.`})}),_jsx(_components.p,{children:`Initialize the SDK, then register an in-app popup event listener as shown below.`}),_jsx(CodeBlock,{filename:``,numberOfLines:`16`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`16`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` notifly`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` from`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'notifly-sdk'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`export`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` async`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` function`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` initNotifly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`() {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` notifly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`initialize`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` projectId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_PROJECT_ID'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` username:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_USERNAME'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:\" // `password` is a backward-compatibility placeholder. Do not enter a real password or API Secret Key.\"})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` password:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'YOUR_USERNAME'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` subscription`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` notifly`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`addInAppMessageEventListener`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`((`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`=>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'InAppMessage event dispatched:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`event`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`eventName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` });`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` return`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` subscription`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsxs(_components.p,{children:[`In your app initialization code, keep the subscription returned by `,_jsx(_components.code,{children:`await initNotifly()`}),`. Call `,_jsx(_components.code,{children:`subscription.remove()`}),` when you no longer need to receive events. Register before triggering a popup; events that occurred before registration are not replayed.`]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`in-app-popup-event-listener-interface`,children:`In-app popup event listener interface`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Android`,id:`android-2`,children:[_jsxs(_components.p,{children:[`Implement the `,_jsx(_components.code,{children:`handleEvent`}),` method of `,_jsx(_components.code,{children:`IInAppMessageEventListener`}),` to listen for in-app popup events. The method receives the following parameters:`]}),_jsx(ParamField,{path:`eventName`,type:`String`,id:`param-event-name`,children:_jsx(_components.p,{children:`The name of the event.`})}),_jsx(ParamField,{path:`eventParams`,type:`Map\u003cString, Any?>?`,id:`param-event-params`,children:_jsxs(_components.p,{children:[`Additional information about the event, or `,_jsx(_components.code,{children:`null`}),` if no parameters are provided.`]})})]}),_jsxs(Tab,{title:`iOS`,id:`ios-2`,children:[_jsxs(_components.p,{children:[`Register an `,_jsx(_components.code,{children:`InAppMessageEventListener`}),` with `,_jsx(_components.code,{children:`addInAppMessageEventListener`}),`.`]}),_jsx(ParamField,{path:`eventName`,type:`String`,id:`param-event-name-1`,children:_jsx(_components.p,{children:`The name of the event.`})}),_jsx(ParamField,{path:`eventParams`,type:`[String: Any]?`,id:`param-event-params-1`,children:_jsxs(_components.p,{children:[`Additional information about the event, or `,_jsx(_components.code,{children:`nil`}),` if no parameters are provided.`]})})]}),_jsxs(Tab,{title:`Flutter`,id:`flutter-2`,children:[_jsxs(_components.p,{children:[`Subscribe to in-app popup events through the `,_jsx(_components.code,{children:`NotiflyPlugin.inAppEvents`}),` stream. Each event is an `,_jsx(_components.code,{children:`InAppMessageEvent`}),` object with the following properties:`]}),_jsx(ParamField,{path:`eventName`,type:`String`,id:`param-event-name-2`,children:_jsx(_components.p,{children:`The name of the event.`})}),_jsx(ParamField,{path:`eventParams`,type:`Map\u003cString, dynamic>?`,id:`param-event-params-2`,children:_jsxs(_components.p,{children:[`Additional information about the event, or `,_jsx(_components.code,{children:`null`}),` if no parameters are provided.`]})})]}),_jsxs(Tab,{title:`React Native`,id:`react-native-2`,children:[_jsxs(_components.p,{children:[`Subscribe to in-app popup events with `,_jsx(_components.code,{children:`notifly.addInAppMessageEventListener`}),`. Each event is an `,_jsx(_components.code,{children:`InAppMessageEvent`}),` object with the following properties:`]}),_jsx(ParamField,{path:`eventName`,type:`string`,id:`param-event-name-3`,children:_jsx(_components.p,{children:`The name of the event.`})}),_jsx(ParamField,{path:`eventParams`,type:`Record\u003cstring, unknown> | null`,id:`param-event-params-3`,children:_jsxs(_components.p,{children:[`Additional information about the event. Values depend on the event and platform, and are `,_jsx(_components.code,{children:`null`}),` if no parameters are provided.`]})})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`in-app-popup-events`,children:`In-app popup events`}),`\n`,_jsxs(Tabs,{children:[_jsxs(Tab,{title:`Android`,id:`android-3`,children:[_jsxs(_components.p,{children:[`The following `,_jsx(_components.code,{children:`eventName`}),` values are passed to `,_jsx(_components.code,{children:`handleEvent`}),`.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`in_app_message_show`}),`: The in-app popup is displayed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`main_button_click`}),`: The user taps the main button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`hide_in_app_message_button_click`}),`: The user taps the `,_jsx(_components.strong,{children:`Do Not Show Again`}),` button.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`close_button_click`}),`: The user taps the close button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`survey_submit_button_click`}),`: The user taps the survey submit button.`]}),`\n`]})]}),_jsxs(Tab,{title:`iOS`,id:`ios-3`,children:[_jsxs(_components.p,{children:[`The following `,_jsx(_components.code,{children:`eventName`}),` values are passed to `,_jsx(_components.code,{children:`addInAppMessageEventListener`}),`.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`in_app_message_show`}),`: The in-app popup is displayed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`main_button_click`}),`: The user taps the main button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`hide_in_app_message_button_click`}),`: The user taps the `,_jsx(_components.strong,{children:`Do Not Show Again`}),` button.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`close_button_click`}),`: The user taps the close button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`survey_submit_button_click`}),`: The user taps the survey submit button.`]}),`\n`]})]}),_jsxs(Tab,{title:`Flutter`,id:`flutter-3`,children:[_jsxs(_components.p,{children:[`The following `,_jsx(_components.code,{children:`eventName`}),` values are passed through `,_jsx(_components.code,{children:`NotiflyPlugin.inAppEvents`}),`.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`in_app_message_show`}),`: The in-app popup is displayed.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`main_button_click`}),`: The user taps the main button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`hide_in_app_message_button_click`}),`: The user taps the `,_jsx(_components.strong,{children:`Do Not Show Again`}),` button.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`close_button_click`}),`: The user taps the close button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`survey_submit_button_click`}),`: The user taps the survey submit button.`]}),`\n`]})]}),_jsxs(Tab,{title:`React Native`,id:`react-native-3`,children:[_jsxs(_components.p,{children:[`The following `,_jsx(_components.code,{children:`eventName`}),` values are passed to `,_jsx(_components.code,{children:`notifly.addInAppMessageEventListener`}),`.`]}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`in_app_message_show`}),`: An in-app popup display event.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`main_button_click`}),`: The user taps the main button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`hide_in_app_message_button_click`}),`: The user taps the `,_jsx(_components.strong,{children:`Do Not Show Again`}),` button.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`close_button_click`}),`: The user taps the close button in the popup.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`survey_submit_button_click`}),`: The user taps the survey submit button.`]}),`\n`]}),_jsx(Note,{children:_jsxs(_components.p,{children:[`Android SDK 1.24.3, included in React Native SDK 4.6.0, has an existing issue: `,_jsx(_components.code,{children:`survey_submit_button_click`}),` is not delivered if the survey `,_jsx(_components.code,{children:`extra_data`}),` has no `,_jsx(_components.code,{children:`link`}),` field. iOS delivers the event under the same condition.`]})})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"In-app popup event listener","description":"Listen for and handle in-app popup events with the Notifly SDK.","href":"/en/advanced/inapp-popup-event-listener"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"In-app popup event listener interface","slug":"in-app-popup-event-listener-interface","depth":2,"children":[]},{"title":"In-app popup events","slug":"in-app-popup-events","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/notifly/f0980be26f2ef402/webmcp.js","/_mintlify/custom/notifly/0bc216feae71c939/attribution.js"],"subdomain":"notifly","siteName":"Notifly Docs","title":"In-app popup event listener - Notifly Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"ko":{"href":"/ko/advanced/inapp-popup-event-listener","matchLevel":1},"en":{"href":"/en/advanced/inapp-popup-event-listener","matchLevel":0},"ja":{"href":"/ja/advanced/inapp-popup-event-listener","matchLevel":1}}},"lastModified":"2026-11-20T02:34:16.041Z","originalFileLocation":"en/advanced/inapp-popup-event-listener.mdx","locale":"en"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=\"light\";if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Listen for and handle in-app popup events with the Notifly SDK.\">\u003cmeta data-mint-head name=\"keywords\" content=\"노티플라이, Notifly, push notification, 푸시 알림, 인앱 팝업, in-app message, 마케팅 자동화, marketing automation, 유저 참여, user engagement, 모바일 SDK, mobile SDK, web push, 웹 푸시, 카카오톡, 이메일, SMS, campaign, 캠페인, user journey, 유저 여정, personalization, 개인화, analytics, 분석, Firebase, Android SDK, iOS SDK, React Native, Flutter, JavaScript SDK, GTM, API\">\u003cmeta data-mint-head name=\"application-name\" content=\"Notifly Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"In-app popup event listener - Notifly Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Listen for and handle in-app popup events with the Notifly SDK.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Notifly Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://notifly.mintlify.site/_mintlify/api/og/v2?division=Advanced+integration\u0026amp;title=In-app+popup+event+listener\u0026amp;description=Listen+for+and+handle+in-app+popup+events+with+the+Notifly+SDK.\u0026amp;theme=0cab931be013e29450d4dfb9\u0026amp;signature=4c2131139dc328180fd90990a6f9a1a4b4c255cdb102711c1ce39e9328d94faf\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"In-app popup event listener - Notifly Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Listen for and handle in-app popup events with the Notifly SDK.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://notifly.mintlify.site/_mintlify/api/og/v2?division=Advanced+integration\u0026amp;title=In-app+popup+event+listener\u0026amp;description=Listen+for+and+handle+in-app+popup+events+with+the+Notifly+SDK.\u0026amp;theme=0cab931be013e29450d4dfb9\u0026amp;signature=4c2131139dc328180fd90990a6f9a1a4b4c255cdb102711c1ce39e9328d94faf\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/notifly/XPUTxSzUsv6_-wtt/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Notifly Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0144CD\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"author\" content=\"Notifly\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/advanced/inapp-popup-event-listener.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ko\" href=\"https://docs.notifly.tech/ko/advanced/inapp-popup-event-listener\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"ja\" href=\"https://docs.notifly.tech/ja/advanced/inapp-popup-event-listener\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.notifly.tech/ko/advanced/inapp-popup-event-listener\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.notifly.tech/#organization\",\"name\":\"Notifly Docs\",\"url\":\"https://docs.notifly.tech\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/notifly/rl-cEZ-semfYDKMK/images/notifly.png?fit=max\u0026auto=format\u0026n=rl-cEZ-semfYDKMK\u0026q=85\u0026s=1fd87113cc3e1e0462340d5e153b1152\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.notifly.tech#website\",\"name\":\"Notifly Docs\",\"url\":\"https://docs.notifly.tech\",\"publisher\":{\"@id\":\"https://docs.notifly.tech/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener#webpage\",\"url\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener\",\"name\":\"In-app popup event listener\",\"description\":\"Listen for and handle in-app popup events with the Notifly SDK.\",\"dateModified\":\"2026-11-20T02:34:16.041Z\",\"isPartOf\":{\"@id\":\"https://docs.notifly.tech#website\"},\"breadcrumb\":{\"@id\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDK integration\",\"item\":\"https://docs.notifly.tech/en/developer-guide/firebase-integration\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mobile SDKs\",\"item\":\"https://docs.notifly.tech/en/developer-guide/android-sdk\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Advanced integration\",\"item\":\"https://docs.notifly.tech/en/advanced\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"In-app popup event listener\",\"item\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener#article\",\"headline\":\"In-app popup event listener\",\"name\":\"In-app popup event listener\",\"description\":\"Listen for and handle in-app popup events with the Notifly SDK.\",\"url\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener\",\"mainEntityOfPage\":{\"@id\":\"https://docs.notifly.tech/en/advanced/inapp-popup-event-listener#webpage\"},\"dateModified\":\"2026-11-20T02:34:16.041Z\",\"publisher\":{\"@id\":\"https://docs.notifly.tech/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.notifly.tech#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Notifly Docs\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Notifly Docs\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/en/advanced/inapp-popup-event-listener.md","siteName":"Notifly Docs","nav":{"global":null,"languages":[{"language":"ko","default":true,"pages":[{"title":"ko","href":"/ko/advanced/inapp-popup-event-listener"}]},{"language":"en","tabs":[{"tab":"User Guides","pages":[{"title":"User Guides","href":"/en"}]},{"tab":"Developer Guides","groups":[{"group":"Getting started","expanded":true,"pages":[{"title":"Notifly developer guide","href":"/en/developer-guide"},{"title":"Key naming for Notifly integrations","href":"/en/developer-guide/key-naming"}]},{"group":"Migration guides","pages":[{"title":"Migrate from Braze Catalogs","href":"/en/developer-guide/migration/braze-catalogs"}]},{"group":"SDK integration","expanded":false,"pages":[{"title":"Connect Firebase","href":"/en/developer-guide/firebase-integration"},{"group":"Mobile SDKs","expanded":false,"pages":[{"group":"Basic integration","pages":[{"title":"Android","href":"/en/developer-guide/android-sdk"},{"title":"iOS","href":"/en/developer-guide/ios-sdk"},{"title":"React Native","href":"/en/developer-guide/react-native-sdk"},{"title":"Flutter","href":"/en/developer-guide/flutter-sdk"}]},{"group":"Advanced integration","expanded":false,"pages":[{"title":"Advanced SDK features by platform","href":"/en/advanced/index"},{"title":"Set the Android notification icon","href":"/en/advanced/push-notification-icon"},{"title":"Request push notification permission","href":"/en/advanced/push-notification-consent"},{"title":"Subscribe to push notification click events","href":"/en/advanced/push-notification-click-events"},{"title":"Customize Android notifications with an interceptor","description":"Modify a notification before the Notifly Android SDK displays it.","href":"/en/advanced/push-notification-interceptor"},{"title":"In-app popup event listener","href":"/en/advanced/inapp-popup-event-listener"},{"title":"Rich push notifications","description":"Set up a Notification Service Extension, App Groups, and the Notifly SDK to display and test rich push notifications on iOS.","href":"/en/advanced/rich-push-notification"},{"title":"WebView","href":"/en/advanced/webview"},{"title":"Open WebView links in an external browser","href":"/en/advanced/webview-external-browser"}]}]},{"group":"Web SDKs","pages":[{"title":"Integrate the JavaScript SDK","href":"/en/developer-guide/javascript-sdk"},{"title":"Set up Google Tag Manager","href":"/en/developer-guide/google-tag-manager"}]},{"title":"Test your integration","href":"/en/integration-test"}]},{"group":"Developer tools","pages":[{"title":"Notifly Remote MCP server","href":"/en/devtools/notifly-remote-mcp"},{"title":"Connect Notifly MCP to ChatGPT","href":"/en/devtools/chatgpt-notifly-app"},{"title":"Connect Notifly to Claude","href":"/en/devtools/claude-notifly-connector"},{"title":"Notifly Agent Skills","href":"/en/devtools/notifly-agent-skills"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/en/api-reference/getting-started"}]}]},{"language":"ja","pages":[{"title":"ja","href":"/ja/advanced/inapp-popup-event-listener"}]}]},"basePath":"","title":"In-app popup event listener - Notifly Docs","deploymentId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","buildId":"dpl_2pTxFtyBudBMYZiCw1MyvoA1wxpd","dynamics":[],"chunks":[]}