@thealteroffice/react-native-adgeist 0.0.3 → 0.0.5
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/android/app/build/generated/source/codegen/java/com/facebook/fbreact/specs/NativeAdgeistSpec.java +42 -0
- package/android/app/build/generated/source/codegen/jni/CMakeLists.txt +36 -0
- package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec-generated.cpp +38 -0
- package/android/app/build/generated/source/codegen/jni/RNAdgeistSpec.h +31 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI-generated.cpp +45 -0
- package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNAdgeistSpec/RNAdgeistSpecJSI.h +80 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/adgeist/AdgeistPackage.kt +15 -7
- package/android/src/main/java/com/adgeist/implementation/AdgeistModuleImpl.kt +63 -40
- package/android/src/newarch/java/com/AdgeistModule.kt +4 -4
- package/android/src/oldarch/java/com/AdgeistModule.kt +4 -4
- package/ios/Adgeist.mm +26 -9
- package/ios/AdgeistImpl.swift +7 -0
- package/lib/module/NativeAdgeist.js.map +1 -1
- package/lib/module/components/AdgeistProvider.js +29 -0
- package/lib/module/components/AdgeistProvider.js.map +1 -0
- package/lib/module/components/BannerAd.js +87 -109
- package/lib/module/components/BannerAd.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/NativeAdgeist.d.ts +2 -2
- package/lib/typescript/src/NativeAdgeist.d.ts.map +1 -1
- package/lib/typescript/src/components/AdgeistProvider.d.ts +18 -0
- package/lib/typescript/src/components/AdgeistProvider.d.ts.map +1 -0
- package/lib/typescript/src/components/BannerAd.d.ts +0 -1
- package/lib/typescript/src/components/BannerAd.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/NativeAdgeist.ts +12 -2
- package/src/components/AdgeistProvider.tsx +41 -0
- package/src/components/BannerAd.tsx +123 -108
- package/src/index.tsx +1 -1
- package/lib/module/components/BottomBannerAd.js +0 -150
- package/lib/module/components/BottomBannerAd.js.map +0 -1
- package/lib/typescript/src/components/BottomBannerAd.d.ts +0 -8
- package/lib/typescript/src/components/BottomBannerAd.d.ts.map +0 -1
- package/src/components/BottomBannerAd.tsx +0 -185
|
@@ -1,93 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useEffect, useState } from 'react';
|
|
4
|
-
import { Dimensions, Image, Linking, StyleSheet, Text, View, TouchableWithoutFeedback } from 'react-native';
|
|
4
|
+
import { Dimensions, Image, Linking, StyleSheet, Text, View, TouchableWithoutFeedback, ActivityIndicator } from 'react-native';
|
|
5
5
|
import Adgeist from "../NativeAdgeist.js";
|
|
6
|
+
import { useAdgeistContext } from "./AdgeistProvider.js";
|
|
6
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
8
|
export const BannerAd = ({
|
|
8
|
-
|
|
9
|
-
dataAdSlot,
|
|
10
|
-
width,
|
|
11
|
-
height
|
|
9
|
+
dataAdSlot
|
|
12
10
|
}) => {
|
|
13
11
|
const [adData, setAdData] = useState(null);
|
|
12
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
13
|
+
const {
|
|
14
|
+
publisherId,
|
|
15
|
+
apiKey,
|
|
16
|
+
domain,
|
|
17
|
+
isTestEnvironment
|
|
18
|
+
} = useAdgeistContext();
|
|
19
|
+
const creativeData = adData?.seatBid?.[0]?.bid?.[0]?.ext;
|
|
14
20
|
useEffect(() => {
|
|
15
21
|
(async () => {
|
|
16
22
|
try {
|
|
17
|
-
|
|
23
|
+
setIsLoading(true);
|
|
24
|
+
const response = await Adgeist.fetchCreative(apiKey, domain, dataAdSlot, publisherId, isTestEnvironment);
|
|
18
25
|
const creative = response;
|
|
19
26
|
setAdData(creative.data);
|
|
20
|
-
|
|
27
|
+
setIsLoading(false);
|
|
28
|
+
if (creative.data.seatBid.length > 0) {
|
|
29
|
+
await Adgeist.sendCreativeAnalytic(creative.data.seatBid?.[0]?.bid?.[0]?.id || '', dataAdSlot, publisherId, 'IMPRESSION', domain, apiKey, creative.data.id, isTestEnvironment);
|
|
30
|
+
}
|
|
21
31
|
} catch (error) {
|
|
22
32
|
console.error('Ad load failed:', error);
|
|
23
33
|
}
|
|
24
34
|
})();
|
|
25
|
-
}, [
|
|
35
|
+
}, [publisherId, dataAdSlot, apiKey, domain, isTestEnvironment]);
|
|
26
36
|
const handleClick = async () => {
|
|
27
|
-
if (adData?.
|
|
28
|
-
await Adgeist.sendCreativeAnalytic(adData
|
|
29
|
-
Linking.openURL(
|
|
37
|
+
if (adData && adData?.seatBid.length > 0) {
|
|
38
|
+
await Adgeist.sendCreativeAnalytic(adData?.seatBid?.[0]?.bid?.[0]?.id || '', dataAdSlot, publisherId, 'CLICK', domain, apiKey, adData.id, isTestEnvironment);
|
|
39
|
+
Linking.openURL(creativeData.ctaUrl).catch(err => console.error('Failed to open URL:', err));
|
|
30
40
|
}
|
|
31
41
|
};
|
|
32
|
-
if (
|
|
42
|
+
if (isLoading) {
|
|
43
|
+
return /*#__PURE__*/_jsx(View, {
|
|
44
|
+
style: styles.loadingOverlayContainer,
|
|
45
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
46
|
+
size: "large",
|
|
47
|
+
color: "#63AA75"
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
if (!creativeData?.creativeUrl) return null;
|
|
33
52
|
return /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
|
|
34
53
|
accessible: true,
|
|
35
54
|
accessibilityLabel: "Ad Banner",
|
|
36
55
|
children: /*#__PURE__*/_jsxs(View, {
|
|
37
|
-
style: styles.
|
|
56
|
+
style: styles.adContainer,
|
|
38
57
|
children: [/*#__PURE__*/_jsx(Image, {
|
|
39
58
|
style: [styles.creative, {
|
|
40
|
-
width,
|
|
41
|
-
height
|
|
59
|
+
width: '100%',
|
|
60
|
+
height: 300
|
|
42
61
|
}],
|
|
43
62
|
source: {
|
|
44
|
-
uri:
|
|
63
|
+
uri: creativeData.creativeUrl
|
|
45
64
|
}
|
|
46
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
47
|
-
style: styles.options,
|
|
48
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
49
|
-
style: styles.option,
|
|
50
|
-
children: "x"
|
|
51
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
52
|
-
style: styles.option,
|
|
53
|
-
children: "i"
|
|
54
|
-
})]
|
|
55
65
|
}), /*#__PURE__*/_jsxs(View, {
|
|
56
66
|
style: styles.adContent,
|
|
57
|
-
children: [/*#__PURE__*/
|
|
58
|
-
style: styles.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
65
|
-
style: styles.titleRow,
|
|
66
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
67
|
-
style: styles.adBadge,
|
|
68
|
-
children: "AD"
|
|
69
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
70
|
-
style: styles.title,
|
|
71
|
-
numberOfLines: 1,
|
|
72
|
-
ellipsizeMode: "tail",
|
|
73
|
-
children: adData.creative.title
|
|
74
|
-
})]
|
|
67
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
68
|
+
style: styles.contentContainer,
|
|
69
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
70
|
+
style: styles.title,
|
|
71
|
+
numberOfLines: 1,
|
|
72
|
+
ellipsizeMode: "tail",
|
|
73
|
+
children: creativeData.creativeTitle
|
|
75
74
|
}), /*#__PURE__*/_jsx(Text, {
|
|
76
75
|
style: styles.description,
|
|
77
76
|
numberOfLines: 1,
|
|
78
77
|
ellipsizeMode: "tail",
|
|
79
|
-
children:
|
|
78
|
+
children: creativeData.creativeDescription
|
|
79
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
80
|
+
style: styles.brandName,
|
|
81
|
+
numberOfLines: 1,
|
|
82
|
+
ellipsizeMode: "tail",
|
|
83
|
+
children: creativeData?.creativeBrandName || 'Brand Name'
|
|
80
84
|
})]
|
|
81
85
|
}), /*#__PURE__*/_jsx(TouchableWithoutFeedback, {
|
|
82
|
-
onPress:
|
|
86
|
+
onPress: () => {
|
|
87
|
+
handleClick();
|
|
88
|
+
},
|
|
83
89
|
accessible: true,
|
|
84
90
|
accessibilityLabel: "Visit Site Button",
|
|
85
|
-
children: /*#__PURE__*/_jsx(
|
|
86
|
-
style: styles.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
})
|
|
91
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
92
|
+
style: [styles.linkButton],
|
|
93
|
+
source: {
|
|
94
|
+
uri: 'https://d2cfeg6k9cklz9.cloudfront.net/onboarding-icons/Button.png'
|
|
95
|
+
}
|
|
91
96
|
})
|
|
92
97
|
})]
|
|
93
98
|
})]
|
|
@@ -95,82 +100,55 @@ export const BannerAd = ({
|
|
|
95
100
|
});
|
|
96
101
|
};
|
|
97
102
|
const styles = StyleSheet.create({
|
|
98
|
-
|
|
103
|
+
adContainer: {
|
|
104
|
+
width: Dimensions.get('window').width,
|
|
99
105
|
backgroundColor: 'white',
|
|
100
|
-
borderRadius:
|
|
101
|
-
},
|
|
102
|
-
creative: {
|
|
103
|
-
resizeMode: 'contain',
|
|
104
|
-
borderTopLeftRadius: 10,
|
|
105
|
-
borderTopRightRadius: 10
|
|
106
|
+
borderRadius: 5
|
|
106
107
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
left: 5
|
|
108
|
+
loadingOverlayContainer: {
|
|
109
|
+
width: '100%',
|
|
110
|
+
height: 375,
|
|
111
|
+
alignItems: 'center',
|
|
112
|
+
justifyContent: 'center'
|
|
113
113
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
height: 20,
|
|
119
|
-
textAlign: 'center'
|
|
114
|
+
creative: {
|
|
115
|
+
resizeMode: 'cover',
|
|
116
|
+
borderTopLeftRadius: 5,
|
|
117
|
+
borderTopRightRadius: 5
|
|
120
118
|
},
|
|
121
119
|
adContent: {
|
|
122
120
|
width: '100%',
|
|
123
121
|
backgroundColor: 'white',
|
|
124
122
|
flexDirection: 'row',
|
|
125
123
|
justifyContent: 'space-between',
|
|
126
|
-
paddingHorizontal: 10,
|
|
127
124
|
paddingVertical: 10,
|
|
125
|
+
paddingHorizontal: 20,
|
|
128
126
|
alignItems: 'center',
|
|
129
|
-
borderBottomLeftRadius:
|
|
130
|
-
borderBottomRightRadius:
|
|
131
|
-
borderTopColor: '#00000022',
|
|
132
|
-
borderTopWidth: 1
|
|
133
|
-
},
|
|
134
|
-
logo: {
|
|
135
|
-
width: 35,
|
|
136
|
-
height: 35,
|
|
137
|
-
resizeMode: 'contain',
|
|
138
|
-
borderRadius: 2
|
|
139
|
-
},
|
|
140
|
-
textContainer: {
|
|
141
|
-
width: Dimensions.get('window').width - 150
|
|
142
|
-
},
|
|
143
|
-
titleRow: {
|
|
144
|
-
flexDirection: 'row',
|
|
145
|
-
alignItems: 'center',
|
|
146
|
-
gap: 5,
|
|
147
|
-
width: Dimensions.get('window').width - 200
|
|
127
|
+
borderBottomLeftRadius: 5,
|
|
128
|
+
borderBottomRightRadius: 5
|
|
148
129
|
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
backgroundColor: 'green',
|
|
152
|
-
width: 40,
|
|
153
|
-
borderRadius: 4,
|
|
154
|
-
textAlign: 'center'
|
|
130
|
+
contentContainer: {
|
|
131
|
+
width: Dimensions.get('window').width - 100
|
|
155
132
|
},
|
|
156
133
|
title: {
|
|
157
|
-
color: 'black'
|
|
134
|
+
color: 'black',
|
|
135
|
+
fontSize: 18,
|
|
136
|
+
fontWeight: 'bold'
|
|
158
137
|
},
|
|
159
138
|
description: {
|
|
160
|
-
color: 'black'
|
|
139
|
+
color: 'black',
|
|
140
|
+
fontSize: 16
|
|
161
141
|
},
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
alignItems: 'center',
|
|
169
|
-
justifyContent: 'center',
|
|
170
|
-
height: 40
|
|
142
|
+
brandName: {
|
|
143
|
+
color: 'black',
|
|
144
|
+
fontSize: 16,
|
|
145
|
+
opacity: 0.6,
|
|
146
|
+
marginTop: 5,
|
|
147
|
+
fontWeight: 'semibold'
|
|
171
148
|
},
|
|
172
|
-
|
|
173
|
-
|
|
149
|
+
linkButton: {
|
|
150
|
+
width: 40,
|
|
151
|
+
height: 40
|
|
174
152
|
}
|
|
175
153
|
});
|
|
176
154
|
//# sourceMappingURL=BannerAd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","Dimensions","Image","Linking","StyleSheet","Text","View","TouchableWithoutFeedback","Adgeist","jsx","_jsx","jsxs","_jsxs","BannerAd","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Dimensions","Image","Linking","StyleSheet","Text","View","TouchableWithoutFeedback","ActivityIndicator","Adgeist","useAdgeistContext","jsx","_jsx","jsxs","_jsxs","BannerAd","dataAdSlot","adData","setAdData","isLoading","setIsLoading","publisherId","apiKey","domain","isTestEnvironment","creativeData","seatBid","bid","ext","response","fetchCreative","creative","data","length","sendCreativeAnalytic","id","error","console","handleClick","openURL","ctaUrl","catch","err","style","styles","loadingOverlayContainer","children","size","color","creativeUrl","accessible","accessibilityLabel","adContainer","width","height","source","uri","adContent","contentContainer","title","numberOfLines","ellipsizeMode","creativeTitle","description","creativeDescription","brandName","creativeBrandName","onPress","linkButton","create","get","backgroundColor","borderRadius","alignItems","justifyContent","resizeMode","borderTopLeftRadius","borderTopRightRadius","flexDirection","paddingVertical","paddingHorizontal","borderBottomLeftRadius","borderBottomRightRadius","fontSize","fontWeight","opacity","marginTop"],"sourceRoot":"../../../src","sources":["components/BannerAd.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SACEC,UAAU,EACVC,KAAK,EACLC,OAAO,EACPC,UAAU,EACVC,IAAI,EACJC,IAAI,EACJC,wBAAwB,EACxBC,iBAAiB,QACZ,cAAc;AACrB,OAAOC,OAAO,MAAM,qBAAkB;AACtC,SAASC,iBAAiB,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAkCtD,OAAO,MAAMC,QAAiC,GAAGA,CAAC;EAAEC;AAAW,CAAC,KAAK;EACnE,MAAM,CAACC,MAAM,EAAEC,SAAS,CAAC,GAAGlB,QAAQ,CAAgB,IAAI,CAAC;EACzD,MAAM,CAACmB,SAAS,EAAEC,YAAY,CAAC,GAAGpB,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAM;IAAEqB,WAAW;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAkB,CAAC,GACtDd,iBAAiB,CAAC,CAAC;EAErB,MAAMe,YAAY,GAAGR,MAAM,EAAES,OAAO,GAAG,CAAC,CAAC,EAAEC,GAAG,GAAG,CAAC,CAAC,EAAEC,GAAmB;EAExE7B,SAAS,CAAC,MAAM;IACd,CAAC,YAAY;MACX,IAAI;QACFqB,YAAY,CAAC,IAAI,CAAC;QAClB,MAAMS,QAAgB,GAAG,MAAMpB,OAAO,CAACqB,aAAa,CAClDR,MAAM,EACNC,MAAM,EACNP,UAAU,EACVK,WAAW,EACXG,iBACF,CAAC;QAED,MAAMO,QAA0B,GAAGF,QAA4B;QAC/DX,SAAS,CAACa,QAAQ,CAACC,IAAI,CAAC;QACxBZ,YAAY,CAAC,KAAK,CAAC;QAEnB,IAAIW,QAAQ,CAACC,IAAI,CAACN,OAAO,CAACO,MAAM,GAAG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DrB,WAAW,EAAE;IACXf,KAAK,EAAE,OAAO;IACdmC,QAAQ,EAAE;EACZ,CAAC;EACDlB,SAAS,EAAE;IACTjB,KAAK,EAAE,OAAO;IACdmC,QAAQ,EAAE,EAAE;IACZE,OAAO,EAAE,GAAG;IACZC,SAAS,EAAE,CAAC;IACZF,UAAU,EAAE;EACd,CAAC;EACDhB,UAAU,EAAE;IACVf,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,0BAAuB;AACrC,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,cAAc,0BAAuB;AACrC,cAAc,iCAA8B","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
2
|
export interface Spec extends TurboModule {
|
|
3
|
-
fetchCreative(adSpaceId: string, publisherId: string): Promise<Object>;
|
|
4
|
-
sendCreativeAnalytic(campaignId: string, adSpaceId: string, publisherId: string, eventType: string): Promise<Object>;
|
|
3
|
+
fetchCreative(apiKey: string, origin: string, adSpaceId: string, publisherId: string, isTestEnvironment: boolean): Promise<Object>;
|
|
4
|
+
sendCreativeAnalytic(campaignId: string, adSpaceId: string, publisherId: string, eventType: string, origin: string, apiKey: string, bidId: string, isTestEnvironment: boolean): Promise<Object>;
|
|
5
5
|
}
|
|
6
6
|
declare const _default: Spec;
|
|
7
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeAdgeist.d.ts","sourceRoot":"","sources":["../../../src/NativeAdgeist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,aAAa,
|
|
1
|
+
{"version":3,"file":"NativeAdgeist.d.ts","sourceRoot":"","sources":["../../../src/NativeAdgeist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,aAAa,CACX,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAAC,MAAM,CAAC,CAAC;IACnB,oBAAoB,CAClB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,iBAAiB,EAAE,OAAO,GACzB,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB;;AAED,wBAAiE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface AdgeistContextType {
|
|
3
|
+
publisherId: string;
|
|
4
|
+
apiKey: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
isTestEnvironment: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface AdgeistProviderPropsType {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
publisherId: string;
|
|
11
|
+
apiKey: string;
|
|
12
|
+
domain: string;
|
|
13
|
+
isTestEnvironment: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const AdgeistProvider: React.FC<AdgeistProviderPropsType>;
|
|
16
|
+
export declare const useAdgeistContext: () => AdgeistContextType;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=AdgeistProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdgeistProvider.d.ts","sourceRoot":"","sources":["../../../../src/components/AdgeistProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,UAAU,kBAAkB;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,UAAU,wBAAwB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AASD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAc9D,CAAC;AAEF,eAAO,MAAM,iBAAiB,0BAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerAd.d.ts","sourceRoot":"","sources":["../../../../src/components/BannerAd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"BannerAd.d.ts","sourceRoot":"","sources":["../../../../src/components/BannerAd.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAwCnD,UAAU,aAAa;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAqH5C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thealteroffice/react-native-adgeist",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Publishers can integrate our SDK to connect their ad spaces to the AdGeist marketplace.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
package/src/NativeAdgeist.ts
CHANGED
|
@@ -2,12 +2,22 @@ import type { TurboModule } from 'react-native';
|
|
|
2
2
|
import { TurboModuleRegistry } from 'react-native';
|
|
3
3
|
|
|
4
4
|
export interface Spec extends TurboModule {
|
|
5
|
-
fetchCreative(
|
|
5
|
+
fetchCreative(
|
|
6
|
+
apiKey: string,
|
|
7
|
+
origin: string,
|
|
8
|
+
adSpaceId: string,
|
|
9
|
+
publisherId: string,
|
|
10
|
+
isTestEnvironment: boolean
|
|
11
|
+
): Promise<Object>;
|
|
6
12
|
sendCreativeAnalytic(
|
|
7
13
|
campaignId: string,
|
|
8
14
|
adSpaceId: string,
|
|
9
15
|
publisherId: string,
|
|
10
|
-
eventType: string
|
|
16
|
+
eventType: string,
|
|
17
|
+
origin: string,
|
|
18
|
+
apiKey: string,
|
|
19
|
+
bidId: string,
|
|
20
|
+
isTestEnvironment: boolean
|
|
11
21
|
): Promise<Object>;
|
|
12
22
|
}
|
|
13
23
|
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
2
|
+
|
|
3
|
+
interface AdgeistContextType {
|
|
4
|
+
publisherId: string;
|
|
5
|
+
apiKey: string;
|
|
6
|
+
domain: string;
|
|
7
|
+
isTestEnvironment: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface AdgeistProviderPropsType {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
publisherId: string;
|
|
13
|
+
apiKey: string;
|
|
14
|
+
domain: string;
|
|
15
|
+
isTestEnvironment: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const AdgeistContext = createContext<AdgeistContextType>({
|
|
19
|
+
publisherId: '',
|
|
20
|
+
apiKey: '',
|
|
21
|
+
domain: '',
|
|
22
|
+
isTestEnvironment: true,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const AdgeistProvider: React.FC<AdgeistProviderPropsType> = ({
|
|
26
|
+
children,
|
|
27
|
+
publisherId = '',
|
|
28
|
+
apiKey = '',
|
|
29
|
+
domain = '',
|
|
30
|
+
isTestEnvironment = true,
|
|
31
|
+
}) => {
|
|
32
|
+
return (
|
|
33
|
+
<AdgeistContext.Provider
|
|
34
|
+
value={{ publisherId, apiKey, domain, isTestEnvironment }}
|
|
35
|
+
>
|
|
36
|
+
{children}
|
|
37
|
+
</AdgeistContext.Provider>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const useAdgeistContext = () => useContext(AdgeistContext);
|