@thealteroffice/react-native-adgeist 0.0.20 → 0.0.22

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 (136) hide show
  1. package/Adgeist.podspec +1 -1
  2. package/README.md +70 -521
  3. package/android/build.gradle +6 -3
  4. package/android/generated/java/com/adgeist/NativeAdgeistSpec.java +11 -11
  5. package/android/generated/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerDelegate.java +55 -0
  6. package/android/generated/java/com/facebook/react/viewmanagers/HTML5AdNativeComponentManagerInterface.java +24 -0
  7. package/android/generated/jni/RNAdgeistSpec-generated.cpp +12 -12
  8. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.cpp +22 -0
  9. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ComponentDescriptors.h +24 -0
  10. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.cpp +60 -0
  11. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/EventEmitters.h +49 -0
  12. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/Props.cpp +28 -0
  13. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/Props.h +52 -0
  14. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +14 -22
  15. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +36 -36
  16. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.cpp +17 -0
  17. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/ShadowNodes.h +32 -0
  18. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/States.cpp +16 -0
  19. package/android/generated/jni/react/renderer/components/RNAdgeistSpec/States.h +29 -0
  20. package/android/src/main/java/com/adgeist/AdgeistPackage.kt +8 -7
  21. package/android/src/main/java/com/adgeist/components/HTML5AdViewManagerImpl.kt +125 -0
  22. package/android/src/main/java/com/adgeist/modules/AdgeistImpl.kt +114 -0
  23. package/android/src/main/java/com/adgeist/utils/CreativeExtensions.kt +151 -0
  24. package/android/src/newarch/java/com/Adgeist.kt +119 -0
  25. package/android/src/newarch/java/com/HTML5AdViewManager.kt +77 -0
  26. package/android/src/oldarch/java/com/Adgeist.kt +132 -0
  27. package/android/src/oldarch/java/com/HTML5AdViewManager.kt +63 -0
  28. package/ios/Adgeist-Bridging-Header.h +3 -0
  29. package/ios/Adgeist.h +1 -1
  30. package/ios/Adgeist.mm +71 -65
  31. package/ios/AdgeistImpl.swift +127 -132
  32. package/ios/NativeHTML5AdManager.h +9 -0
  33. package/ios/NativeHTML5AdManager.mm +178 -0
  34. package/ios/NativeHTML5AdView.swift +136 -0
  35. package/ios/generated/RNAdgeistSpec/ComponentDescriptors.cpp +22 -0
  36. package/ios/generated/RNAdgeistSpec/ComponentDescriptors.h +24 -0
  37. package/ios/generated/RNAdgeistSpec/EventEmitters.cpp +60 -0
  38. package/ios/generated/RNAdgeistSpec/EventEmitters.h +49 -0
  39. package/ios/generated/RNAdgeistSpec/Props.cpp +28 -0
  40. package/ios/generated/RNAdgeistSpec/Props.h +52 -0
  41. package/ios/generated/RNAdgeistSpec/RCTComponentViewHelpers.h +65 -0
  42. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec-generated.mm +17 -17
  43. package/ios/generated/RNAdgeistSpec/RNAdgeistSpec.h +17 -25
  44. package/ios/generated/RNAdgeistSpec/ShadowNodes.cpp +17 -0
  45. package/ios/generated/RNAdgeistSpec/ShadowNodes.h +32 -0
  46. package/ios/generated/RNAdgeistSpec/States.cpp +16 -0
  47. package/ios/generated/RNAdgeistSpec/States.h +29 -0
  48. package/ios/generated/RNAdgeistSpecJSI-generated.cpp +14 -22
  49. package/ios/generated/RNAdgeistSpecJSI.h +36 -36
  50. package/lib/module/cdpclient/index.js +1 -25
  51. package/lib/module/cdpclient/index.js.map +1 -1
  52. package/lib/module/components/HTML5AdView.js +128 -0
  53. package/lib/module/components/HTML5AdView.js.map +1 -0
  54. package/lib/module/components/{BannerAd.js → deprecated/BannerAdView.js} +50 -79
  55. package/lib/module/components/deprecated/BannerAdView.js.map +1 -0
  56. package/lib/module/components/{ConsentModal.js → deprecated/ConsentModal.js} +2 -2
  57. package/lib/module/components/deprecated/ConsentModal.js.map +1 -0
  58. package/lib/module/constants.js +14 -0
  59. package/lib/module/constants.js.map +1 -0
  60. package/lib/module/index.js +3 -2
  61. package/lib/module/index.js.map +1 -1
  62. package/lib/module/{components → providers}/AdgeistProvider.js +10 -35
  63. package/lib/module/providers/AdgeistProvider.js.map +1 -0
  64. package/lib/module/specs/HTML5AdNativeComponent.ts +46 -0
  65. package/lib/module/specs/NativeAdgeist.js.map +1 -0
  66. package/lib/module/types/AdSize.js +2 -0
  67. package/lib/module/types/AdSize.js.map +1 -0
  68. package/lib/module/types/CPMAdResponse.js +2 -0
  69. package/lib/module/types/CPMAdResponse.js.map +1 -0
  70. package/lib/module/types/FixedAdResponse.js +2 -0
  71. package/lib/module/types/FixedAdResponse.js.map +1 -0
  72. package/lib/module/types/HTML5AdNativeComponentProps.js +4 -0
  73. package/lib/module/types/HTML5AdNativeComponentProps.js.map +1 -0
  74. package/lib/module/types/Provider.js +2 -0
  75. package/lib/module/types/Provider.js.map +1 -0
  76. package/lib/typescript/src/cdpclient/index.d.ts +1 -21
  77. package/lib/typescript/src/cdpclient/index.d.ts.map +1 -1
  78. package/lib/typescript/src/components/HTML5AdView.d.ts +3 -0
  79. package/lib/typescript/src/components/HTML5AdView.d.ts.map +1 -0
  80. package/lib/typescript/src/components/deprecated/BannerAdView.d.ts +17 -0
  81. package/lib/typescript/src/components/deprecated/BannerAdView.d.ts.map +1 -0
  82. package/lib/typescript/src/components/deprecated/ConsentModal.d.ts.map +1 -0
  83. package/lib/typescript/src/constants.d.ts +10 -0
  84. package/lib/typescript/src/constants.d.ts.map +1 -0
  85. package/lib/typescript/src/index.d.ts +3 -2
  86. package/lib/typescript/src/index.d.ts.map +1 -1
  87. package/lib/typescript/src/providers/AdgeistProvider.d.ts +9 -0
  88. package/lib/typescript/src/providers/AdgeistProvider.d.ts.map +1 -0
  89. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts +29 -0
  90. package/lib/typescript/src/specs/HTML5AdNativeComponent.d.ts.map +1 -0
  91. package/lib/typescript/src/specs/NativeAdgeist.d.ts +28 -0
  92. package/lib/typescript/src/specs/NativeAdgeist.d.ts.map +1 -0
  93. package/lib/typescript/src/types/AdSize.d.ts +5 -0
  94. package/lib/typescript/src/types/AdSize.d.ts.map +1 -0
  95. package/lib/typescript/src/types/CPMAdResponse.d.ts +25 -0
  96. package/lib/typescript/src/types/CPMAdResponse.d.ts.map +1 -0
  97. package/lib/typescript/src/types/FixedAdResponse.d.ts +50 -0
  98. package/lib/typescript/src/types/FixedAdResponse.d.ts.map +1 -0
  99. package/lib/typescript/src/types/HTML5AdNativeComponentProps.d.ts +24 -0
  100. package/lib/typescript/src/types/HTML5AdNativeComponentProps.d.ts.map +1 -0
  101. package/lib/typescript/src/types/Provider.d.ts +16 -0
  102. package/lib/typescript/src/types/Provider.d.ts.map +1 -0
  103. package/package.json +8 -3
  104. package/react-native.config.js +1 -1
  105. package/src/cdpclient/index.ts +1 -21
  106. package/src/components/HTML5AdView.tsx +161 -0
  107. package/src/components/{BannerAd.tsx → deprecated/BannerAdView.tsx} +80 -115
  108. package/src/components/{ConsentModal.tsx → deprecated/ConsentModal.tsx} +2 -2
  109. package/src/constants.ts +8 -0
  110. package/src/index.tsx +4 -2
  111. package/src/{components → providers}/AdgeistProvider.tsx +26 -60
  112. package/src/specs/HTML5AdNativeComponent.ts +46 -0
  113. package/src/{NativeAdgeist.ts → specs/NativeAdgeist.ts} +26 -25
  114. package/src/types/AdSize.ts +4 -0
  115. package/src/types/CPMAdResponse.ts +26 -0
  116. package/src/types/FixedAdResponse.ts +51 -0
  117. package/src/types/HTML5AdNativeComponentProps.ts +28 -0
  118. package/src/types/Provider.ts +16 -0
  119. package/android/src/main/AndroidManifestNew.xml +0 -2
  120. package/android/src/main/java/com/adgeist/implementation/AdgeistModuleImpl.kt +0 -252
  121. package/android/src/newarch/java/com/AdgeistModule.kt +0 -135
  122. package/android/src/oldarch/java/com/AdgeistModule.kt +0 -148
  123. package/ios/adgeist-Bridging-Header.h +0 -1
  124. package/lib/module/NativeAdgeist.js.map +0 -1
  125. package/lib/module/components/AdgeistProvider.js.map +0 -1
  126. package/lib/module/components/BannerAd.js.map +0 -1
  127. package/lib/module/components/ConsentModal.js.map +0 -1
  128. package/lib/typescript/src/NativeAdgeist.d.ts +0 -28
  129. package/lib/typescript/src/NativeAdgeist.d.ts.map +0 -1
  130. package/lib/typescript/src/components/AdgeistProvider.d.ts +0 -50
  131. package/lib/typescript/src/components/AdgeistProvider.d.ts.map +0 -1
  132. package/lib/typescript/src/components/BannerAd.d.ts +0 -64
  133. package/lib/typescript/src/components/BannerAd.d.ts.map +0 -1
  134. package/lib/typescript/src/components/ConsentModal.d.ts.map +0 -1
  135. /package/lib/module/{NativeAdgeist.js → specs/NativeAdgeist.js} +0 -0
  136. /package/lib/typescript/src/components/{ConsentModal.d.ts → deprecated/ConsentModal.d.ts} +0 -0
package/Adgeist.podspec CHANGED
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
17
17
  s.private_header_files = "ios/**/*.h"
18
18
 
19
- s.dependency "AdgeistKit", '= 0.0.9'
19
+ s.dependency "AdgeistKit", '= 1.0.1-qa'
20
20
 
21
21
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
22
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
package/README.md CHANGED
@@ -4,23 +4,24 @@
4
4
 
5
5
  # @thealteroffice/react-native-adgeist
6
6
 
7
- A React Native SDK that enables publishers to seamlessly integrate their ad spaces with the AdGeist marketplace. Built with TypeScript, Kotlin, and Swift, supporting both Old and New React Native architectures with TurboModule support.
7
+ Integrating Adgeist Mobile Ads SDK into an app is the first step toward displaying ads and earning revenue. Once you've integrated the SDK, you can choose an ad format (such as banner or display) and follow the steps to implement it.
8
8
 
9
- ## 🚀 Features
9
+ ## Before you begin
10
10
 
11
- - **Cross-platform**: iOS and Android support
12
- - ✅ **Modern Architecture**: Support for both legacy and new React Native architectures
13
- - ✅ **TurboModule**: Enhanced performance with TurboModule implementation
14
- - ✅ **TypeScript**: Full TypeScript support with type definitions
15
- - ✅ **Expo Compatible**: Config plugin for seamless Expo integration
16
- - ✅ **Analytics**: Built-in impression and click tracking
17
- - ✅ **Customizable**: Flexible ad display options
18
- - ✅ **Consent Management**: Support for user consent collection for personalized ads
19
- - ✅ **User Data Platform**: Built-in CDP client for user data and event tracking
11
+ To prepare your app, complete the steps in the following sections.
20
12
 
21
- ## 📦 Installation
13
+ ### App prerequisites
22
14
 
23
- ### React Native CLI
15
+ Make sure that your app's build file uses the following values:
16
+
17
+ - Minimum SDK version of 24 or higher
18
+ - Compile SDK version of 35 or higher
19
+
20
+ ## Configure your app
21
+
22
+ ### STEP 1: Initiate the Installation Process for the SDK
23
+
24
+ Install the Adgeist SDK in your React Native project using npm or yarn. This step sets up the necessary package for ad integration.
24
25
 
25
26
  ```bash
26
27
  npm install @thealteroffice/react-native-adgeist
@@ -28,549 +29,97 @@ npm install @thealteroffice/react-native-adgeist
28
29
  yarn add @thealteroffice/react-native-adgeist
29
30
  ```
30
31
 
31
- For iOS, run pod install:
32
+ ### Android Configuration
32
33
 
33
- ```bash
34
- cd ios && pod install
35
- ```
34
+ Add your Adgeist publisher ID, api key and package id, as identified in the Adgeist web interface, to your app's `AndroidManifest.xml` file. To do so, add a `<meta-data>` tag with `android:name="com.adgeistkit.ads.ADGEIST_APP_ID"`, `android:name="com.adgeistkit.ads.ADGEIST_API_KEY"`, and `android:name="com.adgeistkit.ads.ADGEIST_CUSTOM_PACKAGE_OR_BUNDLE_ID"`.
36
35
 
37
- ### Expo Managed Workflow
36
+ You can find your app ID in the Adgeist web interface. For `android:value`, insert your own Adgeist publisher ID, surrounded by quotation marks.
38
37
 
39
- ```bash
40
- npx expo install @thealteroffice/react-native-adgeist
41
- ```
42
-
43
- Rebuild your app:
38
+ ```xml
39
+ <manifest>
40
+ <application>
41
+ <!-- Sample Adgeist app ID: 69326f9fbb280f9241cabc94 -->
42
+ <!-- Sample Adgeist api key: b4e33bb73061d4e33670f229033f14bf770d35b15512dc1f106529e38946e49c -->
43
+ <!-- Sample Adgeist package id: https://adgeist-ad-integration.d49kd6luw1c4m.amplifyapp.com -->
44
44
 
45
- ```bash
46
- npx expo prebuild --clean
47
- ```
45
+ <meta-data
46
+ android:name="com.adgeistkit.ads.ADGEIST_APP_ID"
47
+ android:value="ADGEIST_APP_ID"/>
48
48
 
49
- > **Note**: Requires Expo SDK 50+ and Kotlin template support.
49
+ <meta-data
50
+ android:name="com.adgeistkit.ads.ADGEIST_API_KEY"
51
+ android:value="ADGEIST_API_KEY"/>
50
52
 
51
- ## ⚙️ Peer Dependencies
53
+ <meta-data
54
+ android:name="com.adgeistkit.ads.ADGEIST_CUSTOM_PACKAGE_OR_BUNDLE_ID"
55
+ android:value="ADGEIST_CUSTOM_PACKAGE_OR_BUNDLE_ID"/>
56
+ </application>
57
+ </manifest>
58
+ ```
52
59
 
53
- This package uses `react-native-video` internally for media rendering.
60
+ Replace `ADGEIST_APP_ID`, `ADGEIST_API_KEY`, `ADGEIST_CUSTOM_PACKAGE_OR_BUNDLE_ID` with your Adgeist IDs.
54
61
 
55
- ### Why Peer Dependency?
62
+ ### iOS Configuration
56
63
 
57
- React Native native modules like `react-native-video` should not be bundled inside libraries to prevent native build conflicts.
64
+ #### CocoaPods
58
65
 
59
- We declare `react-native-video` as a peer dependency, so your app controls the version.
66
+ Before you continue, review Using CocoaPods for information on creating and using Podfiles.
60
67
 
61
- ### What You Need to Do
68
+ To use CocoaPods, follow these steps:
62
69
 
63
- - **If your app already uses `react-native-video`**: No action needed.
64
- - **If your app does not have `react-native-video` installed**: Please install it manually:
70
+ In a terminal, run:
65
71
 
66
72
  ```bash
67
- npm install react-native-video@^4.5.2
73
+ cd ios && pod install --repo-update
68
74
  ```
69
75
 
70
- or
71
-
72
- ```bash
73
- yarn add react-native-video@^4.5.2
74
- ```
76
+ #### Update your Info.plist
75
77
 
76
- ### What Happens If You Skip This?
78
+ Update your app's `Info.plist` file to add three keys:
77
79
 
78
- If `react-native-video` is not installed, your app will crash at runtime with:
80
+ A `ADGEIST_APP_ID`, `ADGEIST_API_KEY`, `ADGEIST_CUSTOM_PACKAGE_OR_BUNDLE_ID` key with a string value of your Adgeist IDs found in the Adgeist UI.
79
81
 
80
- ```javascript
81
- Error: Cannot find module 'react-native-video'
82
+ ```xml
83
+ <key>ADGEIST_API_KEY</key>
84
+ <string>e31edf10067897a3904b64b6a4b5f18b1260470183ae203cc521b0479166d597</string>
85
+ <key>ADGEIST_APP_ID</key>
86
+ <string>69326f9fbb280f9241cabc94</string>
87
+ <key>ADGEIST_CUSTOM_PACKAGE_OR_BUNDLE_ID</key>
88
+ <string>https://adgeist-ad-integration.d49kd6luw1c4m.amplifyapp.com/</string>
82
89
  ```
83
90
 
84
- ### Why Not Include It in dependencies?
85
-
86
- Adding `react-native-video` to dependencies directly in this library would:
87
-
88
- - ❌ Cause duplicate native module linking
89
- - ❌ Lead to iOS/Android build failures
90
- - ❌ Break compatibility with apps already using `react-native-video`
91
+ ## Perform the Configuration of AdgeistProvider
91
92
 
92
- ### Dependency Summary
93
-
94
- | Package | Install It? | Why? |
95
- | -------------------- | --------------------- | ------------------------------------------------------------------ |
96
- | `react-native-video` | ✅ **Yes (required)** | Your app must install this manually to satisfy the peer dependency |
97
-
98
- ## 🔧 Setup & Configuration
99
-
100
- ### Basic Setup
101
-
102
- Wrap your app with `AdgeistProvider` to configure global settings:
93
+ Add an `AdgeistProvider` at the root level of your app.
103
94
 
104
95
  ```tsx
105
- import React from 'react';
106
- import {
107
- AdgeistProvider,
108
- BannerAd,
109
- } from '@thealteroffice/react-native-adgeist';
96
+ import { AdgeistProvider } from '@thealteroffice/react-native-adgeist';
110
97
 
111
98
  export default function App() {
112
99
  return (
113
- <AdgeistProvider
114
- publisherId="your-publisher-id"
115
- apiKey="your-api-key"
116
- domain="your-domain"
117
- isTestEnvironment={false}
118
- >
119
- <YourAppContent />
100
+ <AdgeistProvider isTestEnvironment={false}>
101
+ {/* Your app content */}
120
102
  </AdgeistProvider>
121
103
  );
122
104
  }
123
105
  ```
124
106
 
125
- ### Environment Configuration
126
-
127
- Set `isTestEnvironment` based on your app's environment:
128
-
129
- ```tsx
130
- const isTestMode = __DEV__ || process.env.NODE_ENV === 'development';
131
-
132
- <AdgeistProvider
133
- publisherId="your-publisher-id"
134
- apiKey="your-api-key"
135
- domain="your-domain"
136
- isTestEnvironment={isTestMode}
137
- >
138
- ```
139
-
140
- ## 🛡️ Consent Management for Personalized Ads
141
-
142
- To deliver personalized ads, user data and events must be collected and sent to the AdGeist CDP platform. This requires obtaining user consent. You can use your own Consent Management Platform (CMP) or the SDK's built-in CMP.
143
-
144
- ### Using Your Own CMP
145
-
146
- If you use your own CMP, update the consent status in the SDK by calling `updateConsentStatus(boolean)`:
147
-
148
- ```tsx
149
- import { updateConsentStatus } from '@thealteroffice/react-native-adgeist/src/cdpclient';
150
-
151
- const updateConsent = async (hasConsent: boolean) => {
152
- updateConsentStatus(hasConsent);
153
- };
154
- ```
155
-
156
- ### Using SDK's Built-in CMP
157
-
158
- To use the SDK's Consent Management Platform, check the consent status with `getConsentStatus` and display the consent modal if needed:
159
-
160
- ```tsx
161
- import React, { useEffect } from 'react';
162
- import { useAdgeistContext } from '@thealteroffice/react-native-adgeist';
163
- import { getConsentStatus } from '@thealteroffice/react-native-adgeist/src/cdpclient';
164
-
165
- function ConsentHandler() {
166
- const { setAdgeistConsentModal } = useAdgeistContext();
167
-
168
- useEffect(() => {
169
- (async () => {
170
- const consentStatus = await getConsentStatus();
171
- if (consentStatus === 'DENIED') {
172
- setAdgeistConsentModal(true);
173
- }
174
- })();
175
- }, [setAdgeistConsentModal]);
176
-
177
- return null;
178
- }
179
- ```
180
-
181
- The SDK will display a popup to collect user consent when `setAdgeistConsentModal(true)` is called.
182
-
183
- ### User Data and Event Tracking
184
-
185
- #### Log Events
186
-
187
- Use `logEvent` to store user interaction details for analytics:
188
-
189
- ```tsx
190
- import { logEvent } from '@thealteroffice/react-native-adgeist/src/cdpclient';
191
-
192
- const logUserEvent = async (
193
- eventType: string,
194
- eventProperties: Record<string, any>
195
- ) => {
196
- await logEvent({
197
- eventType,
198
- eventProperties,
199
- });
200
- };
201
-
202
- // Example usage
203
- await logUserEvent('product_view', {
204
- productId: '12345',
205
- category: 'electronics',
206
- price: 299.99,
207
- });
208
- ```
209
-
210
- #### Set User Details
211
-
212
- After user login, send user details using `setUserDetails` to associate the entire session lifecycle with the user. These details will be included with all events:
213
-
214
- ```tsx
215
- import { setUserDetails } from '@thealteroffice/react-native-adgeist/src/cdpclient';
216
-
217
- const setUser = async (userDetails: UserDetails) => {
218
- setUserDetails(userDetails);
219
- };
220
-
221
- // Example usage
222
- setUser({
223
- userId: '12345',
224
- userName: 'John Doe',
225
- email: 'user@example.com',
226
- phone: '+1234567890',
227
- });
228
- ```
229
-
230
- ## 📱 Components
231
-
232
- ### AdgeistProvider
233
-
234
- The root provider component that configures the SDK globally.
235
-
236
- #### Props
237
-
238
- | Prop | Type | Required | Default | Description |
239
- | ------------------- | ----------------- | -------- | ------- | --------------------------------------------------- |
240
- | `children` | `React.ReactNode` | ✅ | - | Child components |
241
- | `publisherId` | `string` | ✅ | - | Your publisher ID from AdGeist dashboard |
242
- | `apiKey` | `string` | ✅ | - | Your API key from AdGeist dashboard |
243
- | `domain` | `string` | ✅ | - | Your registered domain (e.g., "https://adgeist.ai") |
244
- | `isTestEnvironment` | `boolean` | ✅ | - | Enable test mode for development |
245
-
246
- #### Example
247
-
248
- ```tsx
249
- <AdgeistProvider
250
- publisherId="67f8ad1350ff1e0870da3f5b"
251
- apiKey="7f6b3361bd6d804edfb40cecf3f42e5ebc0b11bd88d96c8a6d64188b93447ad9"
252
- domain="https://adgeist.ai"
253
- isTestEnvironment={false}
254
- >
255
- <App />
256
- </AdgeistProvider>
257
- ```
258
-
259
- ### BannerAd
260
-
261
- Display banner or video advertisements in your app with responsive layout options.
262
-
263
- #### Props
264
-
265
- | Prop | Type | Required | Default | Description |
266
- | ---------------- | ---------------------------------- | -------- | ---------- | ----------------------------------------------------------- |
267
- | `dataAdSlot` | `string` | ✅ | - | Ad slot ID from your AdGeist dashboard |
268
- | `dataSlotType` | `'banner' \| 'video'` | ❌ | `'banner'` | Type of ad content to display |
269
- | `width` | `number` | ❌ | `0` | Width of the ad banner (ignored if `isResponsive` is true) |
270
- | `height` | `number` | ❌ | `0` | Height of the ad banner (ignored if `isResponsive` is true) |
271
- | `isResponsive` | `boolean` | ✅ | - | Enable responsive layout that adapts to container |
272
- | `responsiveType` | `'SQUARE' \| 'VERTICAL' \| 'WIDE'` | ❌ | `'SQUARE'` | Responsive layout type (used when `isResponsive` is true) |
273
-
274
- #### Examples
275
-
276
- **Basic Banner Ad:**
277
-
278
- ```tsx
279
- import { BannerAd } from '@thealteroffice/react-native-adgeist';
280
-
281
- function MyScreen() {
282
- return (
283
- <View>
284
- <BannerAd
285
- dataAdSlot="686149fac1fd09fff371e53c"
286
- dataSlotType="banner"
287
- width={350}
288
- height={250}
289
- isResponsive={false}
290
- />
291
- </View>
292
- );
293
- }
294
- ```
295
-
296
- **Video Ad:**
297
-
298
- ```tsx
299
- function MyScreen() {
300
- return (
301
- <View>
302
- <BannerAd
303
- dataAdSlot="686149fac1fd09fff371e53c"
304
- dataSlotType="video"
305
- width={350}
306
- height={200}
307
- isResponsive={false}
308
- />
309
- </View>
310
- );
311
- }
312
- ```
313
-
314
- **Responsive Banner Ad:**
315
-
316
- ```tsx
317
- function MyScreen() {
318
- return (
319
- <View style={{ padding: 16 }}>
320
- <BannerAd
321
- dataAdSlot="686149fac1fd09fff371e53c"
322
- dataSlotType="banner"
323
- isResponsive={true}
324
- responsiveType="WIDE"
325
- />
326
- </View>
327
- );
328
- }
329
- ```
330
-
331
- **Responsive Square Ad:**
107
+ ## Implement the Embedding of Ad Slots
332
108
 
333
- ```tsx
334
- function MyScreen() {
335
- return (
336
- <View style={{ width: 300, height: 300 }}>
337
- <BannerAd
338
- dataAdSlot="686149fac1fd09fff371e53c"
339
- dataSlotType="banner"
340
- isResponsive={true}
341
- responsiveType="SQUARE"
342
- />
343
- </View>
344
- );
345
- }
346
- ```
347
-
348
- #### Responsive Types
349
-
350
- | Type | Description | Best Use Case |
351
- | ---------- | ---------------------------- | ----------------------------------------- |
352
- | `SQUARE` | Equal width and height ratio | Social media style ads, product showcases |
353
- | `VERTICAL` | Taller than wide (portrait) | Sidebar ads, mobile story format |
354
- | `WIDE` | Wider than tall (landscape) | Header/footer banners, horizontal layouts |
355
-
356
- #### Ad Slot Types
357
-
358
- | Type | Description | Requirements |
359
- | -------- | --------------------------- | --------------------------------------------- |
360
- | `banner` | Static image advertisements | Standard image formats (JPG, PNG, WebP) |
361
- | `video` | Video advertisements | Requires `react-native-video` peer dependency |
362
-
363
- #### Layout Behavior
364
-
365
- - **Fixed Layout** (`isResponsive: false`): Uses exact `width` and `height` values
366
- - **Responsive Layout** (`isResponsive: true`): Adapts to parent container size based on `responsiveType`
367
-
368
- #### Video Ad Requirements
369
-
370
- For video ads (`dataSlotType: 'video'`), ensure you have installed the required peer dependency:
371
-
372
- ```bash
373
- npm install react-native-video@^4.5.2
374
- ```
375
-
376
- Video ads automatically loop and are muted by default for better user experience.
377
-
378
- ## 🏢 CDP Client API
379
-
380
- The SDK includes a Customer Data Platform (CDP) client for easy data management:
381
-
382
- ```tsx
383
- import {
384
- setUserDetails,
385
- logEvent,
386
- getConsentStatus,
387
- updateConsentStatus,
388
- } from '@thealteroffice/react-native-adgeist';
389
- ```
390
-
391
- ### CDP Client Methods
392
-
393
- #### `setUserDetails(userDetails: UserDetails)`
394
-
395
- Sets user details for the current session.
396
-
397
- ```tsx
398
- setUserDetails({
399
- userId: '12345',
400
- userName: 'John Doe',
401
- email: 'user@example.com',
402
- phone: '+1234567890',
403
- });
404
- ```
405
-
406
- #### `logEvent(event: Event)`
407
-
408
- Logs an event with custom properties.
409
-
410
- ```tsx
411
- logEvent({
412
- eventType: 'purchase',
413
- eventProperties: {
414
- productId: '12345',
415
- amount: 99.99,
416
- currency: 'USD',
417
- },
418
- });
419
- ```
420
-
421
- #### `getConsentStatus(): Promise<'ACCEPTED' | 'DENIED'>`
422
-
423
- Returns the current consent status.
424
-
425
- ```tsx
426
- const status = await getConsentStatus();
427
- ```
428
-
429
- #### `updateConsentStatus(consent: boolean)`
430
-
431
- Updates the user's consent status.
432
-
433
- ```tsx
434
- updateConsentStatus(true); // User granted consent
435
- updateConsentStatus(false); // User denied consent
436
- ```
437
-
438
- ## 🎨 Customization
439
-
440
- ### Custom Event Tracking
441
-
442
- ```tsx
443
- import { logEvent } from '@thealteroffice/react-native-adgeist';
444
-
445
- // Track user interactions
446
- const trackButtonClick = (buttonName: string) => {
447
- logEvent({
448
- eventType: 'button_click',
449
- eventProperties: {
450
- buttonName,
451
- timestamp: Date.now(),
452
- screen: 'home',
453
- },
454
- });
455
- };
456
-
457
- // Track page views
458
- const trackPageView = (pageName: string) => {
459
- logEvent({
460
- eventType: 'page_view',
461
- eventProperties: {
462
- pageName,
463
- timestamp: Date.now(),
464
- },
465
- });
466
- };
467
- ```
468
-
469
- ## 🚀 Advanced Features
470
-
471
- ### Debug Mode
472
-
473
- Enable debug mode to see detailed logs:
474
-
475
- ```tsx
476
- <AdgeistProvider
477
- publisherId="your-publisher-id"
478
- apiKey="your-api-key"
479
- domain="your-domain"
480
- isTestEnvironment={true} // Enable for debug logs
481
- >
482
- ```
483
-
484
- ## 🔧 Troubleshooting
485
-
486
- ### Common Issues
487
-
488
- #### Build Errors
489
-
490
- - **iOS**: Run `cd ios && pod install` after installation
491
- - **Android**: Clean and rebuild: `cd android && ./gradlew clean`
492
-
493
- #### No Ads Showing
494
-
495
- - Verify your `publisherId` and `apiKey` are correct
496
- - Check if `isTestEnvironment` is set appropriately
497
- - Ensure your ad slot ID (`dataAdSlot`) is valid
498
- - Make sure `initializeSdk` is called before fetching ads
499
-
500
- #### Video Not Working
501
-
502
- - Make sure you installed `react-native-video` as described in the peer dependencies section
503
- - For iOS: Run `cd ios && pod install` after installing `react-native-video`
504
-
505
- #### SDK Not Initialized Error
506
-
507
- - Ensure `AdgeistProvider` is wrapping your app
508
- - Call `initializeSdk` before using native methods
509
- - Check that the custom domain is correctly configured
510
-
511
- ### Debug Mode
512
-
513
- Enable debug logging to troubleshoot issues:
109
+ Use the `HTML5AdView` component to display banner ads anywhere in your app. Place this component where you want the ads to appear and the SDK will automatically load and render the ad content.
514
110
 
515
111
  ```tsx
516
- <AdgeistProvider
517
- publisherId="your-publisher-id"
518
- apiKey="your-api-key"
519
- domain="your-domain"
520
- isTestEnvironment={true}
521
- >
522
- ```
523
-
524
- ## 📱 Migration Guide
525
-
526
- ### From v0.0.x to v0.1.x
527
-
528
- 1. Install required peer dependency: `npm install react-native-video@^4.5.2`
529
- 2. Update your `AdgeistProvider` configuration
530
- 3. Replace direct native module calls with CDP client calls:
531
-
532
- ```tsx
533
- // Before
534
- import Adgeist from '@thealteroffice/react-native-adgeist/src/NativeAdgeist';
535
- await Adgeist.setUserDetails(userDetails);
536
-
537
- // After
538
- import { setUserDetails } from '@thealteroffice/react-native-adgeist/src/cdpclient';
539
- setUserDetails(userDetails);
540
- ```
541
-
542
- 4. Run `cd ios && pod install` for iOS projects
543
-
544
- ## 🤝 Contributing
545
-
546
- We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests.
547
-
548
- ### Development Setup
549
-
550
- ```bash
551
- git clone https://github.com/the-alter-office/react-native-adgeist.git
552
- cd react-native-adgeist
553
- yarn install
554
- ```
112
+ import { HTML5AdView } from '@thealteroffice/react-native-adgeist';
555
113
 
556
- ### Running the Example
114
+ <HTML5AdView
115
+ adUnitID="6932a4c022f6786424ce3b84"
116
+ adSize={{ width: 320, height: 480 }}
117
+ onAdLoaded={}
118
+ onAdFailedToLoad={}
119
+ onAdOpened={}
120
+ onAdClosed={}
121
+ onAdClicked={}
122
+ adType="display"
123
+ />;
557
124
 
558
- ```bash
559
- yarn example ios
560
- # or
561
- yarn example android
562
125
  ```
563
-
564
- ## 📄 License
565
-
566
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
567
-
568
- ## 🆘 Support
569
-
570
- - **Documentation**: [GitHub Wiki](https://github.com/the-alter-office/react-native-adgeist/wiki)
571
- - **Issues**: [GitHub Issues](https://github.com/the-alter-office/react-native-adgeist/issues)
572
- - **Discussions**: [GitHub Discussions](https://github.com/the-alter-office/react-native-adgeist/discussions)
573
-
574
- ---
575
-
576
- Made with ❤️ by [The Alter Office](https://github.com/the-alter-office)
@@ -82,8 +82,11 @@ android {
82
82
  "src/newarch",
83
83
 
84
84
  // This is needed to build Kotlin project with NewArch enabled
85
- "${project.buildDir}/generated/source/codegen/java",
86
- "${project.buildDir}/generated/source/codegen/jni"
85
+ // "${project.buildDir}/generated/source/codegen/java",
86
+ // "${project.buildDir}/generated/source/codegen/jni"
87
+
88
+ "generated/java",
89
+ "generated/jni"
87
90
  ]
88
91
  }else{
89
92
  java.srcDirs += ["src/oldarch"]
@@ -101,7 +104,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
101
104
 
102
105
  dependencies {
103
106
  implementation "com.facebook.react:react-android"
104
- implementation "ai.adgeist:adgeistkit:1.0.2"
107
+ implementation "ai.adgeist:adgeistkit:1.1.10-qa"
105
108
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
106
109
  }
107
110