@upeex/ads-sdk 1.1.12 → 1.1.13
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 +6 -17
- package/dist/AdBanner.d.ts +2 -1
- package/dist/core.d.ts +2 -2
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
+
# SDK-apps-React-native
|
|
2
|
+
SDK para aplicaçõe React Native rodarem anúncios:
|
|
1
3
|
|
|
2
|
-
|
|
4
|
+
# Comando para inciar
|
|
5
|
+
npm i @upeex/ads-sdk
|
|
3
6
|
|
|
4
|
-
###
|
|
5
|
-
|
|
6
|
-
function App() {
|
|
7
|
-
return (
|
|
8
|
-
<View>
|
|
9
|
-
{/* ... */}
|
|
10
|
-
<AdBanner client="SEU_CLIENTE" slot="SEU_SLOT" />
|
|
11
|
-
</View>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### Funções
|
|
7
|
+
### Como importar
|
|
17
8
|
|
|
18
9
|
```js
|
|
19
10
|
import AdBanner from '@upeex/ads-sdk';
|
|
@@ -22,6 +13,4 @@ import AdBanner from '@upeex/ads-sdk';
|
|
|
22
13
|
<AdBanner
|
|
23
14
|
client="SEU_CLIENTE"
|
|
24
15
|
slot="SEU_SLOT"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
/
|
package/dist/AdBanner.d.ts
CHANGED
|
@@ -3,8 +3,9 @@ type Props = {
|
|
|
3
3
|
slot: string;
|
|
4
4
|
baseUrl?: string;
|
|
5
5
|
theme?: 'light' | 'dark';
|
|
6
|
+
typeAds?: 'banner' | 'popup';
|
|
6
7
|
style?: object;
|
|
7
8
|
debug?: boolean;
|
|
8
9
|
};
|
|
9
|
-
export default function AdBanner({ client, slot, baseUrl, theme, style, debug, }: Props): any;
|
|
10
|
+
export default function AdBanner({ client, slot, baseUrl, theme, typeAds, style, debug, }: Props): any;
|
|
10
11
|
export {};
|
package/dist/core.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ type LoadAdParams = {
|
|
|
2
2
|
baseUrl: string;
|
|
3
3
|
client: string;
|
|
4
4
|
slot: string;
|
|
5
|
-
|
|
5
|
+
typeAds?: string;
|
|
6
6
|
debug?: boolean;
|
|
7
7
|
};
|
|
8
|
-
export declare function fetchAd({ baseUrl, client, slot,
|
|
8
|
+
export declare function fetchAd({ baseUrl, client, slot, debug, typeAds, }: LoadAdParams): Promise<any>;
|
|
9
9
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ async function getSignals() {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
async function fetchAd({ baseUrl, client, slot,
|
|
42
|
+
async function fetchAd({ baseUrl, client, slot, debug = false, typeAds, }) {
|
|
43
43
|
const log = (...args) => {
|
|
44
44
|
if (debug)
|
|
45
45
|
console.log('[UPEEX ADS]', ...args);
|
|
@@ -53,7 +53,7 @@ async function fetchAd({ baseUrl, client, slot, display = 'BANNER', debug = fals
|
|
|
53
53
|
body: JSON.stringify({
|
|
54
54
|
client,
|
|
55
55
|
slot,
|
|
56
|
-
|
|
56
|
+
typeAds,
|
|
57
57
|
...signals,
|
|
58
58
|
}),
|
|
59
59
|
});
|
|
@@ -79,7 +79,7 @@ async function fetchAd({ baseUrl, client, slot, display = 'BANNER', debug = fals
|
|
|
79
79
|
return ad;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme = 'light', style = {}, debug = false, }) {
|
|
82
|
+
function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme = 'light', typeAds, style = {}, debug = false, }) {
|
|
83
83
|
const [ad, setAd] = useState(null);
|
|
84
84
|
const [error, setError] = useState(null);
|
|
85
85
|
const log = (...args) => {
|
|
@@ -91,7 +91,7 @@ function AdBanner({ client, slot, baseUrl = 'https://app.upeex.com.br/ad', theme
|
|
|
91
91
|
const load = async () => {
|
|
92
92
|
try {
|
|
93
93
|
log('Buscando anúncio', { client, slot });
|
|
94
|
-
const data = await fetchAd({ baseUrl, client, slot, debug });
|
|
94
|
+
const data = await fetchAd({ baseUrl, client, slot, debug, typeAds });
|
|
95
95
|
log('Resposta do servidor', data);
|
|
96
96
|
if (!data || !data.image) {
|
|
97
97
|
setError('Nenhum anúncio disponível');
|