@gabagool-sdk/react-native 0.1.1 → 0.2.0
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/CHANGELOG.md +4 -0
- package/README.md +1 -1
- package/dist/facade.d.ts +8 -1
- package/dist/facade.d.ts.map +1 -1
- package/dist/facade.js +8 -0
- package/package.json +2 -2
- package/src/facade.ts +11 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 0.2.0
|
|
2
|
+
|
|
3
|
+
* `GabagoolAds.onPaidEvent` (e opção `onPaidEvent` no `init`): receita de toda impressão, repassada do core. O lado nativo do RN continua parcial (API presente; emissão coberta pelos testes do core). Requer `@gabagool-sdk/core` ^0.2.0.
|
|
4
|
+
|
|
1
5
|
## 0.1.1
|
|
2
6
|
|
|
3
7
|
* First release published through GitHub Actions trusted publishing (no functional changes).
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ O servidor Gabagool decide segmento, ad units e pisos a cada `init`; o piso vai
|
|
|
5
5
|
**key-value de targeting** (a key de piso é configurada no painel Gabagool, com a grafia exata do
|
|
6
6
|
valor do piso). Sem configuração do servidor, o SDK não exibe anúncios.
|
|
7
7
|
|
|
8
|
-
**Limitação da versão 0.
|
|
8
|
+
**Limitação da versão 0.2.0:** o formato **native** ainda não é suportado neste pacote
|
|
9
9
|
(interstitial, rewarded, banner e app open já funcionam). Android é o alvo testado;
|
|
10
10
|
no iOS, passe `installInfoProvider` no `init` (o plugin de Play Install Referrer é Android-only).
|
|
11
11
|
|
package/dist/facade.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AdHandle, type AdNetworkAdapter, type BootAdResult, type FetchLike, type Gabagool, type GateResult, type InterstitialShowResult, type KVStorage, type RewardedResult, type TelemetryTransport, type WrapperConfig } from '@gabagool-sdk/core';
|
|
1
|
+
import { type AdHandle, type AdNetworkAdapter, type BootAdResult, type FetchLike, type Gabagool, type GateResult, type InterstitialShowResult, type KVStorage, type OnPaidEvent, type RewardedResult, type TelemetryTransport, type WrapperConfig } from '@gabagool-sdk/core';
|
|
2
2
|
import { ReactNativeGmaAdapter } from './adapter.js';
|
|
3
3
|
import { type InstallInfoProvider } from './installInfo.js';
|
|
4
4
|
export interface GabagoolInitOptions {
|
|
@@ -20,6 +20,8 @@ export interface GabagoolInitOptions {
|
|
|
20
20
|
advertisingId?: string;
|
|
21
21
|
debug?: boolean;
|
|
22
22
|
context?: Record<string, unknown>;
|
|
23
|
+
/** atalho para `GabagoolAds.onPaidEvent` */
|
|
24
|
+
onPaidEvent?: OnPaidEvent;
|
|
23
25
|
}
|
|
24
26
|
/** Fachada singleton equivalente à fachada Dart. */
|
|
25
27
|
export declare class GabagoolAds {
|
|
@@ -31,6 +33,11 @@ export declare class GabagoolAds {
|
|
|
31
33
|
/** Resolve quando o `init` terminou (Banner pode montar antes; ver BannerFlow). Nunca rejeita. */
|
|
32
34
|
static whenReady(): Promise<void>;
|
|
33
35
|
private static resetReady;
|
|
36
|
+
/**
|
|
37
|
+
* Receita de TODA impressão (fullscreen, banner e native), para o app repassar a Firebase/Meta/MMP. Disparado além da
|
|
38
|
+
* telemetria; exceção do callback é engolida. Pode ser atribuído antes ou depois do `init`.
|
|
39
|
+
*/
|
|
40
|
+
static onPaidEvent: OnPaidEvent | null;
|
|
34
41
|
static get core(): Gabagool;
|
|
35
42
|
static init(apiKey: string, baseUrl: string, appId: string, options?: GabagoolInitOptions): Promise<void>;
|
|
36
43
|
static showInterstitial(screen?: string): Promise<InterstitialShowResult>;
|
package/dist/facade.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade.d.ts","sourceRoot":"","sources":["../src/facade.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,UAAU,EACf,KAA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AO,IAAI,OAAO,CAAC,IAAI,CAAC;IAC/B,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IACzD,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAChF,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1E,MAAM,CAAC,OAAO,IAAI,IAAI;IAQtB,qGAAqG;IACrG,MAAM,CAAC,aAAa,IAAI,qBAAqB,GAAG,IAAI;CACrD"}
|
package/dist/facade.js
CHANGED
|
@@ -23,8 +23,15 @@ export class GabagoolAds {
|
|
|
23
23
|
if (this.readyState.done)
|
|
24
24
|
this.readyState = this.newReady();
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Receita de TODA impressão (fullscreen, banner e native), para o app repassar a Firebase/Meta/MMP. Disparado além da
|
|
28
|
+
* telemetria; exceção do callback é engolida. Pode ser atribuído antes ou depois do `init`.
|
|
29
|
+
*/
|
|
30
|
+
static onPaidEvent = null;
|
|
26
31
|
static get core() { return this.instance; }
|
|
27
32
|
static async init(apiKey, baseUrl, appId, options = {}) {
|
|
33
|
+
if (options.onPaidEvent)
|
|
34
|
+
this.onPaidEvent = options.onPaidEvent;
|
|
28
35
|
this.lifecycle?.stop();
|
|
29
36
|
this.instance.dispose();
|
|
30
37
|
this.resetReady();
|
|
@@ -71,6 +78,7 @@ export class GabagoolAds {
|
|
|
71
78
|
...(options.context ?? {}),
|
|
72
79
|
},
|
|
73
80
|
debug: options.debug === true,
|
|
81
|
+
onPaidEvent: (e) => GabagoolAds.onPaidEvent?.(e),
|
|
74
82
|
});
|
|
75
83
|
this.lifecycle = new AppStateLifecycle(this.instance);
|
|
76
84
|
this.lifecycle.start();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gabagool-sdk/react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "React Native SDK for Gabagool Apps monetization: interstitial, rewarded and banner ads with server-side config, price floors and gating, on top of Google Mobile Ads (Ad Manager / AdMob).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"prepack": "npm run build"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@gabagool-sdk/core": "^0.
|
|
26
|
+
"@gabagool-sdk/core": "^0.2.0"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@react-native-async-storage/async-storage": "^3.1.1",
|
package/src/facade.ts
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
type GateResult,
|
|
12
12
|
type InterstitialShowResult,
|
|
13
13
|
type KVStorage,
|
|
14
|
+
type OnPaidEvent,
|
|
14
15
|
type RewardedResult,
|
|
15
16
|
type TelemetryTransport,
|
|
16
17
|
type WrapperConfig,
|
|
@@ -40,6 +41,8 @@ export interface GabagoolInitOptions {
|
|
|
40
41
|
advertisingId?: string;
|
|
41
42
|
debug?: boolean;
|
|
42
43
|
context?: Record<string, unknown>;
|
|
44
|
+
/** atalho para `GabagoolAds.onPaidEvent` */
|
|
45
|
+
onPaidEvent?: OnPaidEvent;
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
/** Fachada singleton equivalente à fachada Dart. */
|
|
@@ -62,9 +65,16 @@ export class GabagoolAds {
|
|
|
62
65
|
if (this.readyState.done) this.readyState = this.newReady();
|
|
63
66
|
}
|
|
64
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Receita de TODA impressão (fullscreen, banner e native), para o app repassar a Firebase/Meta/MMP. Disparado além da
|
|
70
|
+
* telemetria; exceção do callback é engolida. Pode ser atribuído antes ou depois do `init`.
|
|
71
|
+
*/
|
|
72
|
+
static onPaidEvent: OnPaidEvent | null = null;
|
|
73
|
+
|
|
65
74
|
static get core(): Gabagool { return this.instance; }
|
|
66
75
|
|
|
67
76
|
static async init(apiKey: string, baseUrl: string, appId: string, options: GabagoolInitOptions = {}): Promise<void> {
|
|
77
|
+
if (options.onPaidEvent) this.onPaidEvent = options.onPaidEvent;
|
|
68
78
|
this.lifecycle?.stop();
|
|
69
79
|
this.instance.dispose();
|
|
70
80
|
this.resetReady();
|
|
@@ -114,6 +124,7 @@ export class GabagoolAds {
|
|
|
114
124
|
...(options.context ?? {}),
|
|
115
125
|
},
|
|
116
126
|
debug: options.debug === true,
|
|
127
|
+
onPaidEvent: (e) => GabagoolAds.onPaidEvent?.(e),
|
|
117
128
|
});
|
|
118
129
|
|
|
119
130
|
this.lifecycle = new AppStateLifecycle(this.instance);
|