diff --git a/src/components/ad/AdBanner.vue b/src/components/ad/AdBanner.vue index f6d3ff55..2ceba49c 100644 --- a/src/components/ad/AdBanner.vue +++ b/src/components/ad/AdBanner.vue @@ -10,22 +10,21 @@ const props = defineProps({ }); const show = ref(false) -// onMounted(() => { -// const adClient = getClient(); -// const adUnitId = getUnit(props.unit); -// show.value = adClient !== undefined && adUnitId !== undefined; +onMounted(() => { + const adClient = getClient(); + const adUnitId = getUnit(props.unit); + show.value = adClient !== undefined && adUnitId !== undefined; -// if(show.value) { -// adClient.showBannerAd({ -// adUnitId, -// containerId: props.id, -// }); -// } -// }); + if(show.value) { + adClient.showBannerAd({ + adUnitId, + containerId: props.id, + }); + } +}); diff --git a/src/components/ad/ad.ts b/src/components/ad/ad.ts index 75fb38b8..f48c8370 100644 --- a/src/components/ad/ad.ts +++ b/src/components/ad/ad.ts @@ -6,10 +6,10 @@ interface ADConfig { } export const confs: Record = { - // "localhost": { - // apiKey: 'XXXX_api_key_staging_XXXX', // An actual API key is generated once you register an app with us. - // environment: 'staging', // use value 'production' when going live - // }, + "localhost": { + apiKey: 'XXXX_api_key_staging_XXXX', // An actual API key is generated once you register an app with us. + environment: 'staging', // use value 'production' when going live + }, "ping.pub": { apiKey: 'persona-pub-0x6ca028de83d9bc438bb3fd7f9620f36b', environment: 'production', @@ -34,6 +34,7 @@ export const UNITS: Record> = { "banner": "1644951b-5022-4544-8a85-11aef8a8f645", "banner_mobile": "81e0527f-475a-42a4-bb9a-ed9967c5d06f", }, + } export function getClient() {