PubAdsService

nestads.PubAdsService

Service를 상속받아서 사용하고 있습니다.

메서드 요약

메서드
설명

이벤트가 발생할 때 자바스크립트 함수를 설정하고 호출할 수

있도록 하는 리스너를 등록합니다.

nestads.Service.addEventListener에서 상속됨

지정된 슬롯에서 광고를 삭제하고 광고를 빈 콘텐츠로 대체합니다.

페이지 로드 시 광고 요청을 사용 중지하지만

PubAdsService.refresh 호출을 사용하여 광고를 요청할 수

있습니다.

이 서비스와 연결된 슬롯 목록을 가져옵니다.

nestads.Service.getSlots에서 상속됨

광고의 초기 요청이 이전 PubAdsService.disableInitialLoad 호출에 의해 성공적으로 중지되었는지 여부를 반환합니다.

페이지의 특정 또는 모든 슬롯에 대한 새 광고를 가져와 표시

합니다.

이전에 등록된 리스너를 제거합니다.

nestads.Service.removeEventListener에서 상속됨

광고의 가로 가운데 맞춤을 사용 또는 사용 중지합니다.

중앙 정렬은 기본적으로 사용 중지되어 있습니다.


clear

clear(slots?: Slot[]): boolean

지정된 슬롯에서 광고를 삭제합니다.

예시

const slot1 = nestads.defineSlot(`${placementCode}`, [728, 90], `${divId}`);
nestads.display(`${divId}`);
// This call to clear both slot1 and slot2.
nestads.pubAds().clear([slot1]);

// This call to clear all slots.
nestads.pubAds().clear();

슬롯을 지정하지 않으면 모든 슬롯을 삭제합니다.

매개변수
설명

slots?: Slot[]

지울 슬롯의 배열입니다. 슬롯을 지정하지 않으면 모든 슬롯을 삭제합니다.

반환 값
설명

boolean

슬롯이 지워지면 true를 반환하고 그렇지 않으면 false를 반환합니다.


disableInitialLoad

disableInitialLoad(): void

페이지 로드 시 광고 요청을 사용 중지합니다.


isInitialLoadDisabled

isInitialLoadDisabled(): boolean

광고의 초기 요청이 이전 PubAdsService.disableInitialLoad 호출에 의해 성공적으로 중지되었는지 여부를 반환합니다.

반환 값
설명

boolean

PubAdsService.disableInitialLoad에 대한 이전 호출이 성공하면 true,

그렇지 않은 경우 false을 반환합니다.


refresh

refresh(slots?: null | Slot[]

모든 슬롯에 대한 새 광고를 가져와 표시합니다.

예시

let slot1 = nestads.defineSlot(`${placementCode}`, [728, 90], `${divId}`);
nestads.display(`${divId}`);

// This call to refresh fetches a new ad for slot1 only.
nestads.pubAds().refresh([slot1]);

// This call to refresh fetches a new ad for each slot.
nestads.pubAds().refresh();
매개변수
설명

slots?: null | Slot[]

새로고침할 슬롯입니다.

슬롯을 지정하지 않으면 모든 슬롯이 새로고침됩니다.


setCentering

setCentering(centerAds: boolean): void

광고의 가로 가운데 맞춤을 사용 또는 사용 중지합니다

예시

nestads.pubAds().setCentering(true);
매개변수
설명

centerAds: boolean

광고를 중앙에 정렬하려면 true하고, 왼쪽에 정렬하려면

false하세요.


Last updated