feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
|
|
@ -1,58 +1,7 @@
|
|||
// apps/desktop/src/main/services/ads/InMobiAdapter.ts
|
||||
// InMobi Programmatic Demand & Mobile/Hybrid Adapter
|
||||
import { UnavailableAdAdapter } from './UnavailableAdAdapter'
|
||||
|
||||
import type {
|
||||
AdNetworkId,
|
||||
AdFormat,
|
||||
AdMediationAuctionRequest,
|
||||
AdCreativePayload,
|
||||
} from '@d3ro/core/types'
|
||||
import type { IAdNetworkAdapter, AdBidResponse } from './BaseAdAdapter'
|
||||
|
||||
export class InMobiAdapter implements IAdNetworkAdapter {
|
||||
readonly networkId: AdNetworkId = 'inmobi'
|
||||
readonly networkName = 'InMobi (Programmatic Exchange)'
|
||||
readonly supportedFormats: AdFormat[] = ['banner_dock', 'rewarded_video']
|
||||
readonly defaultFloorEcpm = 2.8
|
||||
|
||||
async init(): Promise<void> {}
|
||||
|
||||
async requestBid(request: AdMediationAuctionRequest): Promise<AdBidResponse> {
|
||||
const startTime = Date.now()
|
||||
if (!this.supportedFormats.includes(request.format)) {
|
||||
return { hasBid: false, bidEcpm: 0, latencyMs: 5 }
|
||||
}
|
||||
|
||||
const baseEcpm = request.format === 'rewarded_video' ? 6.8 : 3.4
|
||||
const ecpm = baseEcpm + Math.random() * 2.2
|
||||
|
||||
const creative: AdCreativePayload = {
|
||||
id: `inmobi_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`,
|
||||
networkId: this.networkId,
|
||||
networkName: this.networkName,
|
||||
title: 'NordVPN — Secure Your Data with Next-Gen Encryption',
|
||||
description: 'Ultra-fast VPN protection across all your desktop and mobile devices.',
|
||||
ctaText: 'Get 70% Off',
|
||||
clickUrl: 'https://nordvpn.com?utm_source=inmobi',
|
||||
sponsorTag: 'InMobi Exchange',
|
||||
advertiserName: 'Nord Security',
|
||||
bidEcpm: parseFloat(ecpm.toFixed(2)),
|
||||
format: request.format,
|
||||
rewardTokens: 50,
|
||||
durationSeconds: 15,
|
||||
}
|
||||
|
||||
return {
|
||||
hasBid: true,
|
||||
bidEcpm: creative.bidEcpm,
|
||||
creative,
|
||||
latencyMs: Date.now() - startTime + 50,
|
||||
}
|
||||
}
|
||||
|
||||
async reportImpression(adId: string): Promise<void> {}
|
||||
async reportClick(adId: string): Promise<void> {}
|
||||
async reportRewardCompletion(adId: string): Promise<{ success: boolean; tokenReward: number }> {
|
||||
return { success: true, tokenReward: 50 }
|
||||
export class InMobiAdapter extends UnavailableAdAdapter {
|
||||
constructor() {
|
||||
super('inmobi', 'InMobi', ['banner_dock', 'rewarded_video'], 2.8)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue