메인 콘텐츠로 건너뛰기
노티플라이 SDK에서는 인앱 팝업에서 발생하는 이벤트를 감지하고 처리할 수 있는 이벤트 리스너를 제공합니다. 이를 통해 인앱 팝업에서 유저가 특정 행동을 했을 때, 추가적인 행동을 앱에서 처리할 수 있습니다.
  • Android
  • iOS
  • Flutter
해당 기능은 노티플라이 Android SDK 1.16.1 이상 버전부터 지원됩니다.
  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 = BuildConfig.NOTIFLY_PASSWORD,
          )

          // 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")
                  }
              },
          )
      }
  }

인앱 팝업 이벤트 리스너 인터페이스

  • Android
  • iOS
  • Flutter
IInAppMessageEventListener 인터페이스의 handleEvent 메서드를 구현하여 인앱 팝업에서 발생하는 이벤트들을 감지할 수 있습니다. 이 메서드는 다음과 같은 파라미터를 받습니다:
eventName
field name
발생한 이벤트의 이름입니다.
eventParams
field name
발생한 이벤트와 관련된 추가 정보가 포함된 객체입니다.

인앱 팝업 이벤트 목록

  • Android
  • iOS
  • Flutter
handleEvent로 전달되는 eventName 목록입니다.
  • in_app_message_show: 인앱 팝업 노출.
  • main_button_click: 팝업 내 메인 버튼 클릭.
  • hide_in_app_message_button_click: 다시 보지 않기 버튼 클릭.
  • close_button_click: 팝업 내 닫기 버튼 클릭.
  • survey_submit_button_click: 설문 조사 제출 버튼 클릭.