@akross/artemis-ads-sdk 3.5.2 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -9
- package/dist/ads-core/AdsManager.d.ts.map +1 -1
- package/dist/ads-core/util/index.d.ts +0 -1
- package/dist/ads-core/util/index.d.ts.map +1 -1
- package/dist/akross-ads-sdk.esm.js +1 -1
- package/dist/akross-ads-sdk.iife.js +1 -1
- package/dist/akross-ads-sdk.min.js +1 -1
- package/dist/akross-ads-sdk.umd.js +1 -1
- package/dist/core/network/ServicesAds.d.ts +0 -1
- package/dist/core/network/ServicesAds.d.ts.map +1 -1
- package/dist/events/AAEventsCallbackHelper.d.ts +6 -2
- package/dist/events/AAEventsCallbackHelper.d.ts.map +1 -1
- package/dist/modules/external_redirect/AAExternalRedirect.d.ts +11 -0
- package/dist/modules/external_redirect/AAExternalRedirect.d.ts.map +1 -0
- package/dist/modules/external_redirect/index.d.ts +2 -0
- package/dist/modules/external_redirect/index.d.ts.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/poll/AASurveyOverlay.d.ts +1 -0
- package/dist/modules/poll/AASurveyOverlay.d.ts.map +1 -1
- package/dist/modules/rv/programmatic/AARewardedVideo.d.ts.map +1 -1
- package/dist/modules/rv/vast/AAVastPlayer.d.ts +2 -2
- package/dist/modules/rv/vast/AAVastPlayer.d.ts.map +1 -1
- package/dist/modules/rv/vast/AAVastPlayerUI.d.ts +1 -0
- package/dist/modules/rv/vast/AAVastPlayerUI.d.ts.map +1 -1
- package/dist/types/models/AAAdWatchResult.d.ts.map +1 -1
- package/dist/types/models/AACampaignConfig.d.ts +1 -0
- package/dist/types/models/AACampaignConfig.d.ts.map +1 -1
- package/dist/types/models/AAContent.d.ts +30 -0
- package/dist/types/models/AAContent.d.ts.map +1 -1
- package/dist/types/models/AAMedia.d.ts +2 -1
- package/dist/types/models/AAMedia.d.ts.map +1 -1
- package/dist/types/models/AAMediaResults.d.ts +2 -1
- package/dist/types/models/AAMediaResults.d.ts.map +1 -1
- package/dist/types/models/AAMediaTypes.d.ts +2 -2
- package/dist/types/models/AAMediaTypes.d.ts.map +1 -1
- package/dist/utils/AAMediaResultHelper.d.ts +7 -3
- package/dist/utils/AAMediaResultHelper.d.ts.map +1 -1
- package/package.json +6 -2
- package/dist/ads-core/util/AAMediaTypeValidator.d.ts +0 -27
- package/dist/ads-core/util/AAMediaTypeValidator.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -258,10 +258,24 @@ interface SDKConfig {
|
|
|
258
258
|
```typescript
|
|
259
259
|
interface MediaData {
|
|
260
260
|
uuid: string;
|
|
261
|
-
type: 'image';
|
|
261
|
+
type: 'image' | 'video_v2' | 'programatica_v2' | 'survey_v2' | 'external_redirect';
|
|
262
262
|
title: string;
|
|
263
263
|
content: {
|
|
264
|
-
url
|
|
264
|
+
url?: string;
|
|
265
|
+
// Para external_redirect:
|
|
266
|
+
externalRedirect?: {
|
|
267
|
+
link: string;
|
|
268
|
+
infoPrimary?: string;
|
|
269
|
+
infoSecondary?: string;
|
|
270
|
+
actionButtonLabel?: string;
|
|
271
|
+
thumbnail?: string;
|
|
272
|
+
};
|
|
273
|
+
// Ou formato antigo (compatibilidade temporária):
|
|
274
|
+
link?: string;
|
|
275
|
+
infoPrimary?: string;
|
|
276
|
+
infoSecondary?: string;
|
|
277
|
+
actionButtonLabel?: string;
|
|
278
|
+
thumbnail?: string;
|
|
265
279
|
};
|
|
266
280
|
externalUrl?: {
|
|
267
281
|
url: string;
|
|
@@ -273,6 +287,130 @@ interface MediaData {
|
|
|
273
287
|
}
|
|
274
288
|
```
|
|
275
289
|
|
|
290
|
+
## 📱 Tipos de Mídia Suportados
|
|
291
|
+
|
|
292
|
+
O SDK suporta os seguintes tipos de mídia:
|
|
293
|
+
|
|
294
|
+
### 1. **Banner (image)**
|
|
295
|
+
Exibe banners de imagem estática.
|
|
296
|
+
|
|
297
|
+
```javascript
|
|
298
|
+
const media = new AAMedia({
|
|
299
|
+
type: 'image',
|
|
300
|
+
content: { url: 'https://example.com/banner.png' }
|
|
301
|
+
});
|
|
302
|
+
await bannerLoader.loadBanner(media);
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### 2. **Video V2 (video_v2)**
|
|
306
|
+
Reproduz vídeos VAST, VPAID ou IN_HOUSE com suporte a pesquisa.
|
|
307
|
+
|
|
308
|
+
```javascript
|
|
309
|
+
const media = new AAMedia({
|
|
310
|
+
type: 'video_v2',
|
|
311
|
+
content: {
|
|
312
|
+
video: { type: 'VAST', url: 'https://example.com/vast.xml' }
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
const result = await media.click();
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### 3. **Programático V2 (programatica_v2)**
|
|
319
|
+
Anúncios programáticos com waterfall (GAM, MAX, etc.).
|
|
320
|
+
|
|
321
|
+
```javascript
|
|
322
|
+
const media = new AAMedia({
|
|
323
|
+
type: 'programatica_v2',
|
|
324
|
+
content: {
|
|
325
|
+
programmatic: {
|
|
326
|
+
waterfall: [{ type: 'GAM_RV', params: [...] }]
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
const result = await media.click();
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
### 4. **Survey V2 (survey_v2)**
|
|
334
|
+
Pesquisas e surveys interativas.
|
|
335
|
+
|
|
336
|
+
```javascript
|
|
337
|
+
const media = new AAMedia({
|
|
338
|
+
type: 'survey_v2',
|
|
339
|
+
content: {
|
|
340
|
+
survey: { url: 'https://example.com/survey' }
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
const result = await media.click();
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### 5. **External Redirect (external_redirect)** ⭐ Novo
|
|
347
|
+
Redirecionamento externo sem interface. O SDK retorna um resultado indicando que o cliente deve redirecionar o usuário.
|
|
348
|
+
|
|
349
|
+
```javascript
|
|
350
|
+
const media = new AAMedia({
|
|
351
|
+
type: 'external_redirect',
|
|
352
|
+
content: {
|
|
353
|
+
externalRedirect: {
|
|
354
|
+
link: 'https://example.com/redirect',
|
|
355
|
+
infoPrimary: 'Instalação do aplicativo',
|
|
356
|
+
infoSecondary: 'Instale e ganhe recompensas!',
|
|
357
|
+
actionButtonLabel: 'Instalar',
|
|
358
|
+
thumbnail: 'https://example.com/thumbnail.png'
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
const result = await media.click();
|
|
364
|
+
|
|
365
|
+
if (result.result === AAMediaPlayResult.EXTERNAL_REDIRECT) {
|
|
366
|
+
// Buscar URL de redirecionamento do objeto media
|
|
367
|
+
const redirectUrl = result.media.content?.externalRedirect?.link
|
|
368
|
+
|| result.media.content?.link; // Formato antigo
|
|
369
|
+
|
|
370
|
+
// O cliente decide como fazer o redirecionamento
|
|
371
|
+
window.open(redirectUrl, '_blank', 'noopener,noreferrer');
|
|
372
|
+
// ou
|
|
373
|
+
window.location.href = redirectUrl;
|
|
374
|
+
}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
**Características do External Redirect:**
|
|
378
|
+
- ✅ Não exibe interface própria
|
|
379
|
+
- ✅ Envia apenas evento de clique (sem impressão)
|
|
380
|
+
- ✅ Retorna `AAMediaPlayResult.EXTERNAL_REDIRECT` (26)
|
|
381
|
+
- ✅ Cliente é responsável por implementar o redirecionamento
|
|
382
|
+
- ✅ Suporta formato antigo (campos diretamente em `content`) e novo (`content.externalRedirect`)
|
|
383
|
+
|
|
384
|
+
**Formato do objeto (novo):**
|
|
385
|
+
```json
|
|
386
|
+
{
|
|
387
|
+
"type": "external_redirect",
|
|
388
|
+
"content": {
|
|
389
|
+
"externalRedirect": {
|
|
390
|
+
"link": "https://example.com/redirect",
|
|
391
|
+
"infoPrimary": "Título",
|
|
392
|
+
"infoSecondary": "Descrição",
|
|
393
|
+
"actionButtonLabel": "Instalar",
|
|
394
|
+
"thumbnail": "https://example.com/image.png"
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Formato antigo (compatibilidade temporária):**
|
|
401
|
+
```json
|
|
402
|
+
{
|
|
403
|
+
"type": "external_redirect",
|
|
404
|
+
"content": {
|
|
405
|
+
"link": "https://example.com/redirect",
|
|
406
|
+
"infoPrimary": "Título",
|
|
407
|
+
"infoSecondary": "Descrição",
|
|
408
|
+
"actionButtonLabel": "Instalar",
|
|
409
|
+
"thumbnail": "https://example.com/image.png"
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
```
|
|
413
|
+
|
|
276
414
|
## 🌐 WebView Integration
|
|
277
415
|
|
|
278
416
|
O SDK detecta automaticamente quando está rodando em um WebView e configura o bridge de comunicação:
|
|
@@ -407,7 +545,7 @@ npx serve sample
|
|
|
407
545
|
A sample inclui:
|
|
408
546
|
- **Gerenciamento de Usuário**: Definir userId, headers customizados
|
|
409
547
|
- **Gerenciamento de Anúncios**: Solicitar campanhas, testar mídias
|
|
410
|
-
- **Testes de Mídias**: VAST, VPAID, Programático, Banner
|
|
548
|
+
- **Testes de Mídias**: VAST, VPAID, Programático, Banner, Survey V2, External Redirect
|
|
411
549
|
- **Banner Loader**: Teste de diferentes tamanhos de banner
|
|
412
550
|
- **Interface Interativa**: Botões para testar todas as funcionalidades
|
|
413
551
|
- **Logs em Tempo Real**: Console com logs detalhados
|
|
@@ -535,12 +673,17 @@ src/
|
|
|
535
673
|
├── modules/ # Módulos específicos
|
|
536
674
|
│ ├── image/ # Banner Loader
|
|
537
675
|
│ │ └── ArtemisAdsBannerLoader.ts
|
|
538
|
-
│ ├──
|
|
539
|
-
│ │ ├──
|
|
540
|
-
│ │
|
|
541
|
-
│ └──
|
|
542
|
-
│
|
|
543
|
-
│
|
|
676
|
+
│ ├── rv/ # Rewarded Video
|
|
677
|
+
│ │ ├── programmatic/ # Anúncios programáticos
|
|
678
|
+
│ │ │ ├── AARewardedVideo.ts
|
|
679
|
+
│ │ │ └── GAMRewardedVideoWrapper.ts
|
|
680
|
+
│ │ └── vast/ # Player VAST
|
|
681
|
+
│ │ ├── AAVastPlayer.ts
|
|
682
|
+
│ │ └── AAVastPlayerUI.ts
|
|
683
|
+
│ ├── poll/ # Survey V2
|
|
684
|
+
│ │ └── AASurveyOverlay.ts
|
|
685
|
+
│ └── external_redirect/ # External Redirect
|
|
686
|
+
│ └── AAExternalRedirect.ts
|
|
544
687
|
├── types/ # Definições TypeScript
|
|
545
688
|
│ ├── ArtemisSdkConfig.ts # Configurações do SDK
|
|
546
689
|
│ └── models/ # Modelos de dados
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdsManager.d.ts","sourceRoot":"","sources":["../../src/ads-core/AdsManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AdsManager.d.ts","sourceRoot":"","sources":["../../src/ads-core/AdsManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,UAAU,EAAsB,gBAAgB,EAAC,MAAM,iBAAiB,CAAC;AASjF,qBAAa,UAAU;IACrB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,YAAY,CAAyB;gBAEjC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe;IAS1D,eAAe,CAC1B,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,MAAU,EAChB,WAAW,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACvC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,CAAC;IAmFf,WAAW,CACtB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC;IAiCH,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsClH,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;WAsCvF,aAAa,IAAI,MAAM;CAItC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ads-core/util/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ads-core/util/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC"}
|