From 8dd5c85860687c82c0c9de89d132da00b4a24f90 Mon Sep 17 00:00:00 2001 From: NaLLiFFuNT Date: Tue, 17 Oct 2023 15:12:09 +0200 Subject: [PATCH] [APD-XXX] Fix sync for amazon apps --- src/core/sync-apps/sync.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/sync-apps/sync.ts b/src/core/sync-apps/sync.ts index a97a7c5..0355337 100644 --- a/src/core/sync-apps/sync.ts +++ b/src/core/sync-apps/sync.ts @@ -62,10 +62,12 @@ interface AdUnitTemplate extends Partial { } } -enum CustomEventPlatform { - 'ANDROID' = '12', - 'IOS' = '13' -} +const CustomEventPlatform = { + [AppodealPlatform.IOS]: '13', + [AppodealPlatform.ANDROID]: '12', + // same as ANDROID + [AppodealPlatform.AMAZON]: '12' +}; enum PlatformGroup { 'IOS' = 1, @@ -536,7 +538,7 @@ export class Sync { // events const createdCustomEvents = await this.getCustomEventsList(); - const allEventEventsForAllApps:AdmobCustomEvent[] = createdCustomEvents[1].map(x=>getTranslator(AdmobCustomEventTranslator).decode(x) as AdmobCustomEvent) + const allEventEventsForAllApps:AdmobCustomEvent[] = (createdCustomEvents[1] || []).map(x=>getTranslator(AdmobCustomEventTranslator).decode(x) as AdmobCustomEvent) // groups this.createdGroupList = await this.getCreatedMediationGroup();