@thealteroffice/react-native-adgeist 0.0.34 → 0.0.36-beta

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.
Files changed (50) hide show
  1. package/README.md +122 -12
  2. package/android/build.gradle +1 -22
  3. package/android/src/main/java/com/adgeist/components/HTML5AdViewManagerImpl.kt +69 -56
  4. package/android/src/main/java/com/adgeist/components/ReactAdView.kt +21 -0
  5. package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +15 -2
  6. package/android/src/main/java/com/adgeist/utils/CreativeExtensions.kt +21 -28
  7. package/android/src/newarch/java/com/Adgeist.kt +1 -2
  8. package/android/src/newarch/java/com/HTML5AdViewManager.kt +12 -10
  9. package/android/src/oldarch/java/com/Adgeist.kt +1 -2
  10. package/android/src/oldarch/java/com/HTML5AdViewManager.kt +12 -10
  11. package/lib/module/components/HTML5AdView.js +57 -26
  12. package/lib/module/components/HTML5AdView.js.map +1 -1
  13. package/lib/module/constants.js +1 -7
  14. package/lib/module/constants.js.map +1 -1
  15. package/lib/module/env.js +2 -2
  16. package/lib/module/env.js.map +1 -1
  17. package/lib/module/index.js +0 -1
  18. package/lib/module/index.js.map +1 -1
  19. package/lib/module/specs/HTML5AdNativeComponent.ts +12 -3
  20. package/lib/module/utilities.js +1 -0
  21. package/lib/module/utilities.js.map +1 -1
  22. package/lib/typescript/src/components/HTML5AdView.d.ts.map +1 -1
  23. package/lib/typescript/src/constants.d.ts +1 -7
  24. package/lib/typescript/src/constants.d.ts.map +1 -1
  25. package/lib/typescript/src/env.d.ts +2 -2
  26. package/lib/typescript/src/env.d.ts.map +1 -1
  27. package/lib/typescript/src/index.d.ts +0 -1
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts +10 -2
  30. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts.map +1 -1
  31. package/lib/typescript/src/types/FixedAdResponse.d.ts +4 -27
  32. package/lib/typescript/src/types/FixedAdResponse.d.ts.map +1 -1
  33. package/lib/typescript/src/types/HTML5AdNativeComponentProps.d.ts +5 -2
  34. package/lib/typescript/src/types/HTML5AdNativeComponentProps.d.ts.map +1 -1
  35. package/lib/typescript/src/utilities.d.ts +1 -0
  36. package/lib/typescript/src/utilities.d.ts.map +1 -1
  37. package/package.json +1 -1
  38. package/src/components/HTML5AdView.tsx +76 -20
  39. package/src/constants.ts +1 -5
  40. package/src/env.ts +2 -2
  41. package/src/index.tsx +0 -2
  42. package/src/specs/HTML5AdNativeComponent.ts +12 -3
  43. package/src/types/FixedAdResponse.ts +5 -31
  44. package/src/types/HTML5AdNativeComponentProps.ts +6 -2
  45. package/src/utilities.ts +5 -0
  46. package/lib/module/types/AdType.js +0 -16
  47. package/lib/module/types/AdType.js.map +0 -1
  48. package/lib/typescript/src/types/AdType.d.ts +0 -14
  49. package/lib/typescript/src/types/AdType.d.ts.map +0 -1
  50. package/src/types/AdType.ts +0 -16
package/src/constants.ts CHANGED
@@ -1,8 +1,4 @@
1
1
  export const PACKAGE_VERSION_TAG = 'RN';
2
- export const PACKAGE_VERSION = '0.0.34';
3
-
4
- export const AdSizes = {
5
- Responsive: { width: -1, height: -1 },
6
- };
2
+ export const PACKAGE_VERSION = '0.0.36';
7
3
 
8
4
  export const HTML_5_AD_NATIVE_COMPONENT_NAME = 'HTML5AdNativeComponent';
package/src/env.ts CHANGED
@@ -1,3 +1,3 @@
1
- export const PACKAGE_SUFFIX = '';
1
+ export const PACKAGE_SUFFIX = '-beta';
2
2
 
3
- export const BACKEND_DOMAIN = 'https://qa.v2.bg-services.adgeist.ai';
3
+ export const BACKEND_DOMAIN = 'https://beta.v2.bg-services.adgeist.ai';
package/src/index.tsx CHANGED
@@ -3,5 +3,3 @@ export * from './providers/AdgeistProvider';
3
3
  export * from './components/HTML5AdView';
4
4
 
5
5
  export * from './cdpclient/index';
6
-
7
- export * from './types/AdType';
@@ -14,23 +14,32 @@ export interface AdSize {
14
14
  height?: Double;
15
15
  }
16
16
 
17
- export type AdType = 'BANNER' | 'DISPLAY' | 'COMPANION';
18
-
19
17
  export interface AdFailedToLoadEvent {
20
18
  error: string;
21
19
  }
22
20
 
21
+ export interface AdWarningEvent {
22
+ warning: string;
23
+ }
24
+
25
+ export interface AdSizeChangedEvent {
26
+ width: Double;
27
+ height: Double;
28
+ }
29
+
23
30
  export interface NativeProps extends ViewProps {
24
31
  adUnitID: string;
25
32
  adIsResponsive?: boolean;
26
33
  adSize?: AdSize;
27
- adType?: WithDefault<AdType, 'BANNER'>;
34
+ reserveSpace?: WithDefault<boolean, true>;
28
35
 
29
36
  onAdLoaded?: DirectEventHandler<null>;
30
37
  onAdFailedToLoad?: DirectEventHandler<AdFailedToLoadEvent>;
31
38
  onAdOpened?: DirectEventHandler<null>;
32
39
  onAdClosed?: DirectEventHandler<null>;
33
40
  onAdClicked?: DirectEventHandler<null>;
41
+ onAdWarning?: DirectEventHandler<AdWarningEvent>;
42
+ onAdSizeChanged?: DirectEventHandler<AdSizeChangedEvent>;
34
43
  }
35
44
 
36
45
  interface NativeCommands {
@@ -3,19 +3,19 @@ export interface FIXEDADRESPONSE {
3
3
  metaData: string;
4
4
  id: string;
5
5
  generatedAt?: string;
6
- signature?: string;
7
6
  campaignId?: string;
8
7
  advertiser?: Advertiser;
9
8
  type?: string;
9
+ adSpaceType: AdSpaceType;
10
10
  loadType?: string;
11
11
  campaignValidity?: CampaignValidity;
12
- creatives: Creative[];
13
12
  creativesV1: CreativeV1[];
14
13
  displayOptions?: DisplayOptions;
15
14
  frontendCacheDurationSeconds?: number;
16
- impressionRequirements?: ImpressionRequirements;
17
15
  }
18
16
 
17
+ type AdSpaceType = 'banner' | 'display' | 'companion';
18
+
19
19
  interface Advertiser {
20
20
  id?: string;
21
21
  name?: string;
@@ -27,20 +27,6 @@ interface CampaignValidity {
27
27
  endTime?: string;
28
28
  }
29
29
 
30
- interface Creative {
31
- contentModerationResult?: MongoIdWrapper;
32
- createdAt?: MongoDateWrapper;
33
- ctaUrl?: string;
34
- description?: string;
35
- fileName?: string;
36
- fileSize?: number;
37
- fileUrl?: string;
38
- thumbnailUrl?: string;
39
- title?: string;
40
- type?: string;
41
- updatedAt?: MongoDateWrapper;
42
- }
43
-
44
30
  interface CreativeV1 {
45
31
  title?: string;
46
32
  description?: string;
@@ -57,16 +43,9 @@ interface MediaItem {
57
43
  thumbnailUrl?: string;
58
44
  }
59
45
 
60
- interface MongoIdWrapper {
61
- $oid?: string;
62
- }
63
-
64
- interface MongoDateWrapper {
65
- $date?: number;
66
- }
67
-
68
46
  interface DisplayOptions {
69
- allowedFormats?: string[];
47
+ primaryFormats?: string[];
48
+ companionFormats?: string[];
70
49
  dimensions?: Dimensions;
71
50
  isResponsive?: boolean;
72
51
  responsiveType?: string;
@@ -82,8 +61,3 @@ interface StyleOptions {
82
61
  fontColor?: string;
83
62
  fontFamily?: string;
84
63
  }
85
-
86
- interface ImpressionRequirements {
87
- impressionType?: string[];
88
- minViewDurationSeconds?: number;
89
- }
@@ -1,24 +1,28 @@
1
1
  import type { NativeSyntheticEvent } from 'react-native';
2
2
  import type { AdSize } from './AdSize';
3
- import type { AdType } from './AdType';
4
3
 
5
4
  export interface HTML5AdNativeComponentProps {
6
5
  adUnitID: string;
7
6
  adIsResponsive?: boolean;
8
7
  adSize?: AdSize;
9
- adType: AdType;
8
+ reserveSpace?: boolean;
10
9
 
11
10
  onAdLoaded?: () => void;
12
11
  onAdFailedToLoad?: (event: NativeSyntheticEvent<AdFailedToLoadEvent>) => void;
13
12
  onAdOpened?: () => void;
14
13
  onAdClosed?: () => void;
15
14
  onAdClicked?: () => void;
15
+ onAdWarning?: (event: NativeSyntheticEvent<AdWarningEvent>) => void;
16
16
  }
17
17
 
18
18
  export interface AdFailedToLoadEvent {
19
19
  error: string;
20
20
  }
21
21
 
22
+ export interface AdWarningEvent {
23
+ warning: string;
24
+ }
25
+
22
26
  export interface HTML5AdViewRef {
23
27
  loadAd: () => void;
24
28
  destroy: () => void;
package/src/utilities.ts CHANGED
@@ -11,3 +11,8 @@ export const normalizeUrl = (url: string) => {
11
11
  }
12
12
  return url;
13
13
  };
14
+
15
+ export const toAdSizeAxis = (value?: number): number | undefined =>
16
+ typeof value === 'number' && Number.isFinite(value) && value > 0
17
+ ? value
18
+ : undefined;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- /**
4
- * Defines the supported ad types for AdGeist SDK.
5
- * Publishers must use these predefined values when configuring ads.
6
- */
7
-
8
- export const AdTypes = {
9
- /** Small rectangular banner ads typically displayed at the top or bottom of the screen */
10
- BANNER: 'BANNER',
11
- /** Standard display advertisements */
12
- DISPLAY: 'DISPLAY',
13
- /** Companion ads displayed alongside other content (requires minimum 320x320 dimensions) */
14
- COMPANION: 'COMPANION'
15
- };
16
- //# sourceMappingURL=AdType.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["AdTypes","BANNER","DISPLAY","COMPANION"],"sourceRoot":"../../../src","sources":["types/AdType.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAGA,OAAO,MAAMA,OAAO,GAAG;EACrB;EACAC,MAAM,EAAE,QAAkB;EAE1B;EACAC,OAAO,EAAE,SAAmB;EAE5B;EACAC,SAAS,EAAE;AACb,CAAU","ignoreList":[]}
@@ -1,14 +0,0 @@
1
- /**
2
- * Defines the supported ad types for AdGeist SDK.
3
- * Publishers must use these predefined values when configuring ads.
4
- */
5
- export type AdType = 'BANNER' | 'DISPLAY' | 'COMPANION';
6
- export declare const AdTypes: {
7
- /** Small rectangular banner ads typically displayed at the top or bottom of the screen */
8
- readonly BANNER: AdType;
9
- /** Standard display advertisements */
10
- readonly DISPLAY: AdType;
11
- /** Companion ads displayed alongside other content (requires minimum 320x320 dimensions) */
12
- readonly COMPANION: AdType;
13
- };
14
- //# sourceMappingURL=AdType.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AdType.d.ts","sourceRoot":"","sources":["../../../../src/types/AdType.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAExD,eAAO,MAAM,OAAO;IAClB,0FAA0F;qBACtE,MAAM;IAE1B,sCAAsC;sBAChB,MAAM;IAE5B,4FAA4F;wBAClE,MAAM;CACxB,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Defines the supported ad types for AdGeist SDK.
3
- * Publishers must use these predefined values when configuring ads.
4
- */
5
- export type AdType = 'BANNER' | 'DISPLAY' | 'COMPANION';
6
-
7
- export const AdTypes = {
8
- /** Small rectangular banner ads typically displayed at the top or bottom of the screen */
9
- BANNER: 'BANNER' as AdType,
10
-
11
- /** Standard display advertisements */
12
- DISPLAY: 'DISPLAY' as AdType,
13
-
14
- /** Companion ads displayed alongside other content (requires minimum 320x320 dimensions) */
15
- COMPANION: 'COMPANION' as AdType,
16
- } as const;