Banner 및 MREC 광고

Banner 및 MREC ads는 앱 레이아웃의 일부(주로 화면 상단이나 하단, 또는 스크롤 가능한 콘텐츠 내부)를 차지하는 직사각형 광고 포맷입니다. 사용자가 앱과 상호작용하는 동안에도 계속 표시되므로 게임 플레이나 앱 사용을 방해하지 않으며, 설정된 시간 간격에 따라 자동으로 새로고침될 수 있습니다.

다음 섹션에서는 Banner 또는 MREC ad를 로드, 표시 및 숨기는 방법을 설명합니다.

Loading a Banner or MREC

Banner 또는 MREC를 로드하려면 create_banner() 또는 create_mrec()를 호출합니다. 해당 메서드에 Ad Unit ID, 원하는 ad view 위치, 그리고 (Banners의 경우) 원하는 배경색을 전달합니다. MAX가 자동으로 광고 크기를 조정해 줍니다:

local banner_ad_unit_ids = {
  android = "«android-ad-unit-ID»",
  ios = "«ios-ad-unit-ID»"
}

function initialize_banner_ads()
  local ad_unit_id

  local sysinfo = sys.get_sys_info()
  if sysinfo.system_name == "Android" then
    ad_unit_id = banner_ad_unit_ids["android"]
  elseif sysinfo.system_name == "iPhone OS" then
    ad_unit_id = banner_ad_unit_ids["ios"]
  end

  -- Banners are automatically sized to 320x50 on phones and 728x90 on tablets
  applovin.create_banner(ad_unit_id, "bottom_center")

  -- Set background color for banners to be fully functional
  -- this sets it to black - USE HEX STRINGS ONLY
  applovin.set_banner_background_color(ad_unit_id, "#000000");

사용 가능한 전체 위치 옵션 목록은 다음과 같습니다.

  • top_left
  • top_center
  • top_right
  • center_left
  • centered
  • center_right
  • bottom_left
  • bottom_center
  • bottom_right

MAX는 휴대폰에서는 320×50, 태블릿에서는 728×90으로 Banners 크기를 자동 조정합니다. MRECs는 휴대폰과 태블릿 모두에서 300×250 크기로 조정됩니다.

Showing and hiding a Banner or MREC

Banner 또는 MREC를 표시하려면 show_banner() 또는 show_mrec()를 호출합니다:

applovin.show_banner(«ad-unit-ID»)

Banner 또는 MREC를 숨기려면 hide_banner() 또는 hide_mrec()를 호출합니다:

applovin.hide_banner(«ad-unit-ID»)

자동 새로고침 중지 및 시작

광고의 자동 새로고침을 중지하고 싶을 수 있습니다. 예를 들어, 광고를 숨기거나 수동으로 새로고침하려는 경우에 이 작업을 수행할 수 있습니다. 다음 코드를 사용하여 자동 새로고침을 중지합니다:

applovin.show_banner(«ad-unit-ID»)
applovin.stop_banner_auto_refresh(«ad-unit-ID»)

다음 코드를 사용하여 광고의 자동 새로고침을 시작합니다:

applovin.start_banner_auto_refresh(«ad-unit-ID»)

search