react-native-buzzvil-ad 0.1.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/Buzzvil.podspec +26 -0
- package/LICENSE +20 -0
- package/README.md +58 -0
- package/android/build.gradle +76 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/buzzvil/BuzzvilModule.kt +90 -0
- package/android/src/main/java/com/buzzvil/BuzzvilNativeAdView.kt +250 -0
- package/android/src/main/java/com/buzzvil/BuzzvilNativeAdViewManager.kt +62 -0
- package/android/src/main/java/com/buzzvil/BuzzvilPackage.kt +37 -0
- package/android/src/main/res/layout/buzzvil_native_ad_banner.xml +68 -0
- package/android/src/main/res/layout/buzzvil_native_ad_card.xml +39 -0
- package/ios/Buzzvil.h +5 -0
- package/ios/Buzzvil.mm +100 -0
- package/ios/BuzzvilNativeAdView.h +14 -0
- package/ios/BuzzvilNativeAdView.mm +423 -0
- package/lib/module/BuzzvilNativeAdView.js +16 -0
- package/lib/module/BuzzvilNativeAdView.js.map +1 -0
- package/lib/module/BuzzvilNativeAdView.native.js +42 -0
- package/lib/module/BuzzvilNativeAdView.native.js.map +1 -0
- package/lib/module/BuzzvilNativeAdViewNativeComponent.ts +22 -0
- package/lib/module/NativeBuzzvil.js +32 -0
- package/lib/module/NativeBuzzvil.js.map +1 -0
- package/lib/module/buzzvil.js +25 -0
- package/lib/module/buzzvil.js.map +1 -0
- package/lib/module/buzzvil.native.js +64 -0
- package/lib/module/buzzvil.native.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/layout.js +39 -0
- package/lib/module/layout.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/BuzzvilNativeAdView.d.ts +3 -0
- package/lib/typescript/src/BuzzvilNativeAdView.d.ts.map +1 -0
- package/lib/typescript/src/BuzzvilNativeAdView.native.d.ts +196 -0
- package/lib/typescript/src/BuzzvilNativeAdView.native.d.ts.map +1 -0
- package/lib/typescript/src/BuzzvilNativeAdViewNativeComponent.d.ts +25 -0
- package/lib/typescript/src/BuzzvilNativeAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/NativeBuzzvil.d.ts +72 -0
- package/lib/typescript/src/NativeBuzzvil.d.ts.map +1 -0
- package/lib/typescript/src/buzzvil.d.ts +7 -0
- package/lib/typescript/src/buzzvil.d.ts.map +1 -0
- package/lib/typescript/src/buzzvil.native.d.ts +25 -0
- package/lib/typescript/src/buzzvil.native.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/layout.d.ts +6 -0
- package/lib/typescript/src/layout.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +44 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +159 -0
- package/src/BuzzvilNativeAdView.native.tsx +48 -0
- package/src/BuzzvilNativeAdView.tsx +12 -0
- package/src/BuzzvilNativeAdViewNativeComponent.ts +22 -0
- package/src/NativeBuzzvil.ts +76 -0
- package/src/buzzvil.native.tsx +65 -0
- package/src/buzzvil.tsx +29 -0
- package/src/index.tsx +10 -0
- package/src/layout.ts +21 -0
- package/src/types.ts +45 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import NativeComponent from './BuzzvilNativeAdViewNativeComponent';
|
|
4
|
+
import { sizeForLayout } from "./layout.js";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export { sizeForLayout };
|
|
7
|
+
const DEFAULT_LAYOUT = '300x250';
|
|
8
|
+
export function toNativeProps(props) {
|
|
9
|
+
const {
|
|
10
|
+
layout,
|
|
11
|
+
onAdLoaded,
|
|
12
|
+
onAdFailed,
|
|
13
|
+
onAdClicked,
|
|
14
|
+
onImpressed,
|
|
15
|
+
onRewarded,
|
|
16
|
+
...rest
|
|
17
|
+
} = props;
|
|
18
|
+
return {
|
|
19
|
+
...rest,
|
|
20
|
+
layout: layout ?? DEFAULT_LAYOUT,
|
|
21
|
+
onAdLoaded: onAdLoaded ? e => onAdLoaded(e.nativeEvent) : undefined,
|
|
22
|
+
onAdFailed: onAdFailed ? e => onAdFailed(e.nativeEvent) : undefined,
|
|
23
|
+
// No payload — pass the friendly handler straight through (it ignores the
|
|
24
|
+
// native event arg). Avoids an empty wrapper that could mislead a future
|
|
25
|
+
// contributor copying the pattern for a payload-carrying event.
|
|
26
|
+
onAdClicked,
|
|
27
|
+
onImpressed,
|
|
28
|
+
onRewarded: onRewarded ? e => onRewarded(e.nativeEvent) : undefined
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export function BuzzvilNativeAdView(props) {
|
|
32
|
+
const native = toNativeProps(props);
|
|
33
|
+
const size = sizeForLayout(props.layout);
|
|
34
|
+
// Apply the inventory size as a DEFAULT style; the consumer's `style` is
|
|
35
|
+
// last in the array, so it overrides. `style` is set once here (the explicit
|
|
36
|
+
// prop wins over the one carried in `native`'s spread).
|
|
37
|
+
return /*#__PURE__*/_jsx(NativeComponent, {
|
|
38
|
+
...native,
|
|
39
|
+
style: [size, props.style]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=BuzzvilNativeAdView.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeComponent","sizeForLayout","jsx","_jsx","DEFAULT_LAYOUT","toNativeProps","props","layout","onAdLoaded","onAdFailed","onAdClicked","onImpressed","onRewarded","rest","e","nativeEvent","undefined","BuzzvilNativeAdView","native","size","style"],"sourceRoot":"../../src","sources":["BuzzvilNativeAdView.native.tsx"],"mappings":";;AAAA,OAAOA,eAAe,MAAM,sCAAsC;AAClE,SAASC,aAAa,QAAQ,aAAU;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGzC,SAASF,aAAa;AAEtB,MAAMG,cAAc,GAAG,SAAS;AAEhC,OAAO,SAASC,aAAaA,CAACC,KAA+B,EAAE;EAC7D,MAAM;IACJC,MAAM;IACNC,UAAU;IACVC,UAAU;IACVC,WAAW;IACXC,WAAW;IACXC,UAAU;IACV,GAAGC;EACL,CAAC,GAAGP,KAAK;EACT,OAAO;IACL,GAAGO,IAAI;IACPN,MAAM,EAAEA,MAAM,IAAIH,cAAc;IAChCI,UAAU,EAAEA,UAAU,GACjBM,CAAqD,IACpDN,UAAU,CAACM,CAAC,CAACC,WAAW,CAAC,GAC3BC,SAAS;IACbP,UAAU,EAAEA,UAAU,GACjBK,CAAqD,IACpDL,UAAU,CAACK,CAAC,CAACC,WAAW,CAAC,GAC3BC,SAAS;IACb;IACA;IACA;IACAN,WAAW;IACXC,WAAW;IACXC,UAAU,EAAEA,UAAU,GACjBE,CAAwC,IAAKF,UAAU,CAACE,CAAC,CAACC,WAAW,CAAC,GACvEC;EACN,CAAC;AACH;AAEA,OAAO,SAASC,mBAAmBA,CAACX,KAA+B,EAAE;EACnE,MAAMY,MAAM,GAAGb,aAAa,CAACC,KAAK,CAAC;EACnC,MAAMa,IAAI,GAAGlB,aAAa,CAACK,KAAK,CAACC,MAAM,CAAC;EACxC;EACA;EACA;EACA,oBAAOJ,IAAA,CAACH,eAAe;IAAA,GAAMkB,MAAM;IAAUE,KAAK,EAAE,CAACD,IAAI,EAAEb,KAAK,CAACc,KAAK;EAAE,CAAE,CAAC;AAC7E","ignoreList":[]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { codegenNativeComponent, type ViewProps } from 'react-native';
|
|
2
|
+
import type { CodegenTypes } from 'react-native';
|
|
3
|
+
|
|
4
|
+
// Flat primitive payloads — codegen events cannot carry nested objects/enums.
|
|
5
|
+
type AdLoadedEvent = Readonly<{
|
|
6
|
+
width: CodegenTypes.Double;
|
|
7
|
+
height: CodegenTypes.Double;
|
|
8
|
+
}>;
|
|
9
|
+
type AdFailedEvent = Readonly<{ code: string; message: string }>;
|
|
10
|
+
type RewardedEvent = Readonly<{ success: boolean }>;
|
|
11
|
+
|
|
12
|
+
export interface NativeProps extends ViewProps {
|
|
13
|
+
unitId: string;
|
|
14
|
+
layout?: string; // friendly union + default live in the JS wrapper; codegen sees a plain string
|
|
15
|
+
onAdLoaded?: CodegenTypes.DirectEventHandler<AdLoadedEvent>;
|
|
16
|
+
onAdFailed?: CodegenTypes.DirectEventHandler<AdFailedEvent>;
|
|
17
|
+
onAdClicked?: CodegenTypes.DirectEventHandler<Readonly<{}>>;
|
|
18
|
+
onImpressed?: CodegenTypes.DirectEventHandler<Readonly<{}>>;
|
|
19
|
+
onRewarded?: CodegenTypes.DirectEventHandler<RewardedEvent>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default codegenNativeComponent<NativeProps>('BuzzvilNativeAdView');
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* TurboModule spec for the native `Buzzvil` module — a thin bridge over
|
|
7
|
+
* Buzzvil's BuzzBenefit v6 SDKs (Android / iOS).
|
|
8
|
+
*
|
|
9
|
+
* This file is the **source of truth**: codegen generates the native
|
|
10
|
+
* interfaces from it. The codegen type system is restricted, so the spec
|
|
11
|
+
* intentionally uses **primitives only** — no optional fields, no object
|
|
12
|
+
* params, no enums/unions. Friendly types (optional fields, the `'MALE' |
|
|
13
|
+
* 'FEMALE'` gender union) live in `./types` and are applied in the JS
|
|
14
|
+
* wrapper (`./buzzvil.native.tsx`).
|
|
15
|
+
*
|
|
16
|
+
* ## Sentinel contract (MUST be interpreted identically by both native impls)
|
|
17
|
+
*
|
|
18
|
+
* Because the spec has no optionals, the JS wrapper encodes "not provided"
|
|
19
|
+
* as sentinel values. `BuzzvilModule.kt` and `Buzzvil.mm` must treat them
|
|
20
|
+
* the same way or the platforms will silently diverge:
|
|
21
|
+
*
|
|
22
|
+
* - `gender`: `'MALE'` or `'FEMALE'`. **Empty string `''` → do not set gender**
|
|
23
|
+
* (pass `null` to the native user builder).
|
|
24
|
+
* - `birthYear`: a 4-digit year. **`0` → do not set birth year** (pass `null`).
|
|
25
|
+
* - `routePath`: a BenefitHub page number from the Buzzvil admin. **`''` → no
|
|
26
|
+
* route path** (open the default hub page).
|
|
27
|
+
* - `showHistory`: `true` → open the BenefitHub history/earnings page
|
|
28
|
+
* (Android `BuzzBenefitHubPage.HISTORY` / iOS `.history` query params).
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
export default TurboModuleRegistry.getEnforcing('Buzzvil');
|
|
32
|
+
//# sourceMappingURL=NativeBuzzvil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeBuzzvil.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAA0B,cAAc;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAiDA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,SAAS,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Web fallback. Buzzvil's BuzzBenefit SDKs are mobile-only, so every method
|
|
5
|
+
* throws **at call time** (never at import time — importing must not break the
|
|
6
|
+
* web bundle). The `.native.tsx` counterpart is used on iOS/Android.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const UNSUPPORTED = 'react-native-buzzvil is not supported on web.';
|
|
10
|
+
export function initialize(_appId) {
|
|
11
|
+
throw new Error(UNSUPPORTED);
|
|
12
|
+
}
|
|
13
|
+
export function login(_user) {
|
|
14
|
+
return Promise.reject(new Error(UNSUPPORTED));
|
|
15
|
+
}
|
|
16
|
+
export function logout() {
|
|
17
|
+
throw new Error(UNSUPPORTED);
|
|
18
|
+
}
|
|
19
|
+
export function isLoggedIn() {
|
|
20
|
+
return Promise.reject(new Error(UNSUPPORTED));
|
|
21
|
+
}
|
|
22
|
+
export function showBenefitHub(_options = {}) {
|
|
23
|
+
throw new Error(UNSUPPORTED);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=buzzvil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNSUPPORTED","initialize","_appId","Error","login","_user","Promise","reject","logout","isLoggedIn","showBenefitHub","_options"],"sourceRoot":"../../src","sources":["buzzvil.tsx"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,WAAW,GAAG,+CAA+C;AAEnE,OAAO,SAASC,UAAUA,CAACC,MAAc,EAAQ;EAC/C,MAAM,IAAIC,KAAK,CAACH,WAAW,CAAC;AAC9B;AAEA,OAAO,SAASI,KAAKA,CAACC,KAAkB,EAAiB;EACvD,OAAOC,OAAO,CAACC,MAAM,CAAC,IAAIJ,KAAK,CAACH,WAAW,CAAC,CAAC;AAC/C;AAEA,OAAO,SAASQ,MAAMA,CAAA,EAAS;EAC7B,MAAM,IAAIL,KAAK,CAACH,WAAW,CAAC;AAC9B;AAEA,OAAO,SAASS,UAAUA,CAAA,EAAqB;EAC7C,OAAOH,OAAO,CAACC,MAAM,CAAC,IAAIJ,KAAK,CAACH,WAAW,CAAC,CAAC;AAC/C;AAEA,OAAO,SAASU,cAAcA,CAACC,QAA2B,GAAG,CAAC,CAAC,EAAQ;EACrE,MAAM,IAAIR,KAAK,CAACH,WAAW,CAAC;AAC9B","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import Buzzvil from "./NativeBuzzvil.js";
|
|
4
|
+
/**
|
|
5
|
+
* Native (iOS/Android) implementation of the public Buzzvil API. Maps the
|
|
6
|
+
* friendly types in `./types` onto the primitive-only native spec, applying
|
|
7
|
+
* the sentinel contract documented in `./NativeBuzzvil`.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** Initialize the BuzzBenefit SDK. Call once, before any other method. */
|
|
11
|
+
export function initialize(appId) {
|
|
12
|
+
Buzzvil.initialize(appId);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Dev-only sanity checks for `userId`. Buzzvil requires a non-PII, stable,
|
|
17
|
+
* ASCII identifier (≤255 chars) — not an email or login id. Returns a list of
|
|
18
|
+
* human-readable warnings (empty when the id looks fine). Pure: `login` logs
|
|
19
|
+
* these via `console.warn` only under `__DEV__`; it never alters behavior or
|
|
20
|
+
* blocks the call (the SDK is the source of truth on acceptance).
|
|
21
|
+
*/
|
|
22
|
+
export function userIdWarnings(userId) {
|
|
23
|
+
const warnings = [];
|
|
24
|
+
if (!userId) {
|
|
25
|
+
warnings.push('userId is empty.');
|
|
26
|
+
return warnings;
|
|
27
|
+
}
|
|
28
|
+
if (userId.includes('@')) {
|
|
29
|
+
warnings.push('userId looks like an email — Buzzvil requires a non-PII, stable identifier (not an email/login id); ads may be rejected.');
|
|
30
|
+
}
|
|
31
|
+
if (userId.length > 255) {
|
|
32
|
+
warnings.push('userId exceeds 255 characters.');
|
|
33
|
+
}
|
|
34
|
+
if ([...userId].some(ch => ch.charCodeAt(0) > 127)) {
|
|
35
|
+
warnings.push('userId should be ASCII.');
|
|
36
|
+
}
|
|
37
|
+
return warnings;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Log a user in. Resolves on success, rejects on SDK failure. */
|
|
41
|
+
export function login(user) {
|
|
42
|
+
if (__DEV__) {
|
|
43
|
+
for (const message of userIdWarnings(user.userId)) {
|
|
44
|
+
console.warn(`[buzzvil] login: ${message}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return Buzzvil.login(user.userId, user.gender ?? '', user.birthYear ?? 0);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Log the current user out. */
|
|
51
|
+
export function logout() {
|
|
52
|
+
Buzzvil.logout();
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Whether a user is currently logged in. */
|
|
56
|
+
export function isLoggedIn() {
|
|
57
|
+
return Buzzvil.isLoggedIn();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Present the BenefitHub (offerwall) over the current screen. */
|
|
61
|
+
export function showBenefitHub(options = {}) {
|
|
62
|
+
Buzzvil.showBenefitHub(options.routePath ?? '', options.showHistory ?? false);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=buzzvil.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Buzzvil","initialize","appId","userIdWarnings","userId","warnings","push","includes","length","some","ch","charCodeAt","login","user","__DEV__","message","console","warn","gender","birthYear","logout","isLoggedIn","showBenefitHub","options","routePath","showHistory"],"sourceRoot":"../../src","sources":["buzzvil.native.tsx"],"mappings":";;AAAA,OAAOA,OAAO,MAAM,oBAAiB;AAGrC;AACA;AACA;AACA;AACA;;AAEA;AACA,OAAO,SAASC,UAAUA,CAACC,KAAa,EAAQ;EAC9CF,OAAO,CAACC,UAAU,CAACC,KAAK,CAAC;AAC3B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,MAAc,EAAY;EACvD,MAAMC,QAAkB,GAAG,EAAE;EAC7B,IAAI,CAACD,MAAM,EAAE;IACXC,QAAQ,CAACC,IAAI,CAAC,kBAAkB,CAAC;IACjC,OAAOD,QAAQ;EACjB;EACA,IAAID,MAAM,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE;IACxBF,QAAQ,CAACC,IAAI,CACX,0HACF,CAAC;EACH;EACA,IAAIF,MAAM,CAACI,MAAM,GAAG,GAAG,EAAE;IACvBH,QAAQ,CAACC,IAAI,CAAC,gCAAgC,CAAC;EACjD;EACA,IAAI,CAAC,GAAGF,MAAM,CAAC,CAACK,IAAI,CAAEC,EAAE,IAAKA,EAAE,CAACC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,EAAE;IACpDN,QAAQ,CAACC,IAAI,CAAC,yBAAyB,CAAC;EAC1C;EACA,OAAOD,QAAQ;AACjB;;AAEA;AACA,OAAO,SAASO,KAAKA,CAACC,IAAiB,EAAiB;EACtD,IAAIC,OAAO,EAAE;IACX,KAAK,MAAMC,OAAO,IAAIZ,cAAc,CAACU,IAAI,CAACT,MAAM,CAAC,EAAE;MACjDY,OAAO,CAACC,IAAI,CAAC,oBAAoBF,OAAO,EAAE,CAAC;IAC7C;EACF;EACA,OAAOf,OAAO,CAACY,KAAK,CAACC,IAAI,CAACT,MAAM,EAAES,IAAI,CAACK,MAAM,IAAI,EAAE,EAAEL,IAAI,CAACM,SAAS,IAAI,CAAC,CAAC;AAC3E;;AAEA;AACA,OAAO,SAASC,MAAMA,CAAA,EAAS;EAC7BpB,OAAO,CAACoB,MAAM,CAAC,CAAC;AAClB;;AAEA;AACA,OAAO,SAASC,UAAUA,CAAA,EAAqB;EAC7C,OAAOrB,OAAO,CAACqB,UAAU,CAAC,CAAC;AAC7B;;AAEA;AACA,OAAO,SAASC,cAAcA,CAACC,OAA0B,GAAG,CAAC,CAAC,EAAQ;EACpEvB,OAAO,CAACsB,cAAc,CAACC,OAAO,CAACC,SAAS,IAAI,EAAE,EAAED,OAAO,CAACE,WAAW,IAAI,KAAK,CAAC;AAC/E","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["initialize","login","logout","isLoggedIn","showBenefitHub","BuzzvilNativeAdView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,KAAK,EACLC,MAAM,EACNC,UAAU,EACVC,cAAc,QACT,WAAW;AAElB,SAASC,mBAAmB,QAAQ,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Default inventory sizes for the Native-ad layout variants, shared by the
|
|
5
|
+
* native and web `BuzzvilNativeAdView` so the box matches on every platform.
|
|
6
|
+
*
|
|
7
|
+
* Under Fabric the component's frame comes from the JS shadow node (the
|
|
8
|
+
* `style`), so the native side's per-size height is only a hint — without a
|
|
9
|
+
* JS-side height iOS bounds stay 0 and `onAdLoaded` never fires. The wrapper
|
|
10
|
+
* therefore applies one of these as a DEFAULT style; a consumer `style` wins.
|
|
11
|
+
*/
|
|
12
|
+
const LAYOUT_SIZE = {
|
|
13
|
+
'320x50': {
|
|
14
|
+
width: 320,
|
|
15
|
+
height: 50
|
|
16
|
+
},
|
|
17
|
+
'320x100': {
|
|
18
|
+
width: 320,
|
|
19
|
+
height: 100
|
|
20
|
+
},
|
|
21
|
+
'320x130': {
|
|
22
|
+
width: 320,
|
|
23
|
+
height: 130
|
|
24
|
+
},
|
|
25
|
+
'300x250': {
|
|
26
|
+
width: 300,
|
|
27
|
+
height: 250
|
|
28
|
+
},
|
|
29
|
+
'320x480': {
|
|
30
|
+
width: 320,
|
|
31
|
+
height: 480
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Resolve the default size for a layout; unknown/undefined → `300x250`. */
|
|
36
|
+
export function sizeForLayout(layout) {
|
|
37
|
+
return LAYOUT_SIZE[layout ?? '300x250'] ?? LAYOUT_SIZE['300x250'];
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LAYOUT_SIZE","width","height","sizeForLayout","layout"],"sourceRoot":"../../src","sources":["layout.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,WAA8D,GAAG;EACrE,QAAQ,EAAE;IAAEC,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAG,CAAC;EACpC,SAAS,EAAE;IAAED,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EACtC,SAAS,EAAE;IAAED,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EACtC,SAAS,EAAE;IAAED,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI,CAAC;EACtC,SAAS,EAAE;IAAED,KAAK,EAAE,GAAG;IAAEC,MAAM,EAAE;EAAI;AACvC,CAAC;;AAED;AACA,OAAO,SAASC,aAAaA,CAACC,MAAe,EAAE;EAC7C,OAAOJ,WAAW,CAACI,MAAM,IAAI,SAAS,CAAC,IAAIJ,WAAW,CAAC,SAAS,CAAC;AACnE","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuzzvilNativeAdView.d.ts","sourceRoot":"","sources":["../../../src/BuzzvilNativeAdView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAS,CAAC;AAExD,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,KAAK,GACN,EAAE,wBAAwB,+BAI1B"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { sizeForLayout } from './layout.js';
|
|
2
|
+
import type { BuzzvilNativeAdViewProps } from './types.js';
|
|
3
|
+
export { sizeForLayout };
|
|
4
|
+
export declare function toNativeProps(props: BuzzvilNativeAdViewProps): {
|
|
5
|
+
layout: import("./types.js").BuzzvilNativeAdLayout;
|
|
6
|
+
onAdLoaded: ((e: {
|
|
7
|
+
nativeEvent: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
}) => void) | undefined;
|
|
12
|
+
onAdFailed: ((e: {
|
|
13
|
+
nativeEvent: {
|
|
14
|
+
code: string;
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
}) => void) | undefined;
|
|
18
|
+
onAdClicked: (() => void) | undefined;
|
|
19
|
+
onImpressed: (() => void) | undefined;
|
|
20
|
+
onRewarded: ((e: {
|
|
21
|
+
nativeEvent: {
|
|
22
|
+
success: boolean;
|
|
23
|
+
};
|
|
24
|
+
}) => void) | undefined;
|
|
25
|
+
unitId: string;
|
|
26
|
+
style?: import("react-native").StyleProp<Readonly<Omit<Readonly<Omit<Readonly<{
|
|
27
|
+
display?: "none" | "flex" | "contents";
|
|
28
|
+
width?: import("react-native").DimensionValue;
|
|
29
|
+
height?: import("react-native").DimensionValue;
|
|
30
|
+
bottom?: import("react-native").DimensionValue;
|
|
31
|
+
end?: import("react-native").DimensionValue;
|
|
32
|
+
left?: import("react-native").DimensionValue;
|
|
33
|
+
right?: import("react-native").DimensionValue;
|
|
34
|
+
start?: import("react-native").DimensionValue;
|
|
35
|
+
top?: import("react-native").DimensionValue;
|
|
36
|
+
inset?: import("react-native").DimensionValue;
|
|
37
|
+
insetBlock?: import("react-native").DimensionValue;
|
|
38
|
+
insetBlockEnd?: import("react-native").DimensionValue;
|
|
39
|
+
insetBlockStart?: import("react-native").DimensionValue;
|
|
40
|
+
insetInline?: import("react-native").DimensionValue;
|
|
41
|
+
insetInlineEnd?: import("react-native").DimensionValue;
|
|
42
|
+
insetInlineStart?: import("react-native").DimensionValue;
|
|
43
|
+
minWidth?: import("react-native").DimensionValue;
|
|
44
|
+
maxWidth?: import("react-native").DimensionValue;
|
|
45
|
+
minHeight?: import("react-native").DimensionValue;
|
|
46
|
+
maxHeight?: import("react-native").DimensionValue;
|
|
47
|
+
margin?: import("react-native").DimensionValue;
|
|
48
|
+
marginBlock?: import("react-native").DimensionValue;
|
|
49
|
+
marginBlockEnd?: import("react-native").DimensionValue;
|
|
50
|
+
marginBlockStart?: import("react-native").DimensionValue;
|
|
51
|
+
marginBottom?: import("react-native").DimensionValue;
|
|
52
|
+
marginEnd?: import("react-native").DimensionValue;
|
|
53
|
+
marginHorizontal?: import("react-native").DimensionValue;
|
|
54
|
+
marginInline?: import("react-native").DimensionValue;
|
|
55
|
+
marginInlineEnd?: import("react-native").DimensionValue;
|
|
56
|
+
marginInlineStart?: import("react-native").DimensionValue;
|
|
57
|
+
marginLeft?: import("react-native").DimensionValue;
|
|
58
|
+
marginRight?: import("react-native").DimensionValue;
|
|
59
|
+
marginStart?: import("react-native").DimensionValue;
|
|
60
|
+
marginTop?: import("react-native").DimensionValue;
|
|
61
|
+
marginVertical?: import("react-native").DimensionValue;
|
|
62
|
+
padding?: import("react-native").DimensionValue;
|
|
63
|
+
paddingBlock?: import("react-native").DimensionValue;
|
|
64
|
+
paddingBlockEnd?: import("react-native").DimensionValue;
|
|
65
|
+
paddingBlockStart?: import("react-native").DimensionValue;
|
|
66
|
+
paddingBottom?: import("react-native").DimensionValue;
|
|
67
|
+
paddingEnd?: import("react-native").DimensionValue;
|
|
68
|
+
paddingHorizontal?: import("react-native").DimensionValue;
|
|
69
|
+
paddingInline?: import("react-native").DimensionValue;
|
|
70
|
+
paddingInlineEnd?: import("react-native").DimensionValue;
|
|
71
|
+
paddingInlineStart?: import("react-native").DimensionValue;
|
|
72
|
+
paddingLeft?: import("react-native").DimensionValue;
|
|
73
|
+
paddingRight?: import("react-native").DimensionValue;
|
|
74
|
+
paddingStart?: import("react-native").DimensionValue;
|
|
75
|
+
paddingTop?: import("react-native").DimensionValue;
|
|
76
|
+
paddingVertical?: import("react-native").DimensionValue;
|
|
77
|
+
borderWidth?: number;
|
|
78
|
+
borderBottomWidth?: number;
|
|
79
|
+
borderEndWidth?: number;
|
|
80
|
+
borderLeftWidth?: number;
|
|
81
|
+
borderRightWidth?: number;
|
|
82
|
+
borderStartWidth?: number;
|
|
83
|
+
borderTopWidth?: number;
|
|
84
|
+
position?: "absolute" | "relative" | "static";
|
|
85
|
+
flexDirection?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
86
|
+
flexWrap?: "wrap" | "nowrap" | "wrap-reverse";
|
|
87
|
+
justifyContent?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly";
|
|
88
|
+
alignItems?: "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
|
|
89
|
+
alignSelf?: "auto" | "flex-start" | "flex-end" | "center" | "stretch" | "baseline";
|
|
90
|
+
alignContent?: "flex-start" | "flex-end" | "center" | "stretch" | "space-between" | "space-around" | "space-evenly";
|
|
91
|
+
overflow?: "visible" | "hidden" | "scroll";
|
|
92
|
+
flex?: number;
|
|
93
|
+
flexGrow?: number;
|
|
94
|
+
flexShrink?: number;
|
|
95
|
+
flexBasis?: number | string;
|
|
96
|
+
aspectRatio?: number | string;
|
|
97
|
+
boxSizing?: "border-box" | "content-box";
|
|
98
|
+
zIndex?: number;
|
|
99
|
+
direction?: "inherit" | "ltr" | "rtl";
|
|
100
|
+
rowGap?: number | string;
|
|
101
|
+
columnGap?: number | string;
|
|
102
|
+
gap?: number | string;
|
|
103
|
+
}>, "pointerEvents" | "shadowColor" | "shadowOffset" | "shadowOpacity" | "shadowRadius" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "cursor" | "boxShadow" | "filter" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<Omit<Readonly<{
|
|
104
|
+
shadowColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
105
|
+
shadowOffset?: Readonly<{
|
|
106
|
+
width?: number;
|
|
107
|
+
height?: number;
|
|
108
|
+
}>;
|
|
109
|
+
shadowOpacity?: number;
|
|
110
|
+
shadowRadius?: number;
|
|
111
|
+
}>, never> & Omit<Readonly<{}>, never>>, "pointerEvents" | "transform" | "transformOrigin" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "cursor" | "boxShadow" | "filter" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
112
|
+
transform?: ReadonlyArray<Readonly<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MaximumOneOf<import("react-native/types_generated/Libraries/StyleSheet/private/_TransformStyle").MergeUnion<{
|
|
113
|
+
readonly perspective: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
114
|
+
} | {
|
|
115
|
+
readonly rotate: string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
116
|
+
} | {
|
|
117
|
+
readonly rotateX: string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
118
|
+
} | {
|
|
119
|
+
readonly rotateY: string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
120
|
+
} | {
|
|
121
|
+
readonly rotateZ: string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
122
|
+
} | {
|
|
123
|
+
readonly scale: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
124
|
+
} | {
|
|
125
|
+
readonly scaleX: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
126
|
+
} | {
|
|
127
|
+
readonly scaleY: number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
128
|
+
} | {
|
|
129
|
+
readonly translateX: number | string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
130
|
+
} | {
|
|
131
|
+
readonly translateY: number | string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
132
|
+
} | {
|
|
133
|
+
readonly translate: [number | string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node, number | string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node] | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
134
|
+
} | {
|
|
135
|
+
readonly skewX: string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
136
|
+
} | {
|
|
137
|
+
readonly skewY: string | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
138
|
+
} | {
|
|
139
|
+
readonly matrix: ReadonlyArray<number | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node> | import("react-native/types_generated/Libraries/Animated/AnimatedExports").Node;
|
|
140
|
+
}>>>> | string;
|
|
141
|
+
transformOrigin?: [string | number, string | number, string | number] | string;
|
|
142
|
+
}>, "pointerEvents" | "backfaceVisibility" | "backgroundColor" | "borderColor" | "borderCurve" | "borderBottomColor" | "borderEndColor" | "borderLeftColor" | "borderRightColor" | "borderStartColor" | "borderTopColor" | "borderBlockColor" | "borderBlockEndColor" | "borderBlockStartColor" | "borderRadius" | "borderBottomEndRadius" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStartRadius" | "borderEndEndRadius" | "borderEndStartRadius" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopEndRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStartRadius" | "borderStyle" | "borderWidth" | "borderBottomWidth" | "borderEndWidth" | "borderLeftWidth" | "borderRightWidth" | "borderStartWidth" | "borderTopWidth" | "opacity" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "elevation" | "cursor" | "boxShadow" | "filter" | "mixBlendMode" | "experimental_backgroundImage" | "experimental_backgroundSize" | "experimental_backgroundPosition" | "experimental_backgroundRepeat" | "isolation"> & Omit<Readonly<{
|
|
143
|
+
backfaceVisibility?: "visible" | "hidden";
|
|
144
|
+
backgroundColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
145
|
+
borderColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
146
|
+
borderCurve?: "circular" | "continuous";
|
|
147
|
+
borderBottomColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
148
|
+
borderEndColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
149
|
+
borderLeftColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
150
|
+
borderRightColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
151
|
+
borderStartColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
152
|
+
borderTopColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
153
|
+
borderBlockColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
154
|
+
borderBlockEndColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
155
|
+
borderBlockStartColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
156
|
+
borderRadius?: number | string;
|
|
157
|
+
borderBottomEndRadius?: number | string;
|
|
158
|
+
borderBottomLeftRadius?: number | string;
|
|
159
|
+
borderBottomRightRadius?: number | string;
|
|
160
|
+
borderBottomStartRadius?: number | string;
|
|
161
|
+
borderEndEndRadius?: number | string;
|
|
162
|
+
borderEndStartRadius?: number | string;
|
|
163
|
+
borderStartEndRadius?: number | string;
|
|
164
|
+
borderStartStartRadius?: number | string;
|
|
165
|
+
borderTopEndRadius?: number | string;
|
|
166
|
+
borderTopLeftRadius?: number | string;
|
|
167
|
+
borderTopRightRadius?: number | string;
|
|
168
|
+
borderTopStartRadius?: number | string;
|
|
169
|
+
borderStyle?: "solid" | "dotted" | "dashed";
|
|
170
|
+
borderWidth?: number;
|
|
171
|
+
borderBottomWidth?: number;
|
|
172
|
+
borderEndWidth?: number;
|
|
173
|
+
borderLeftWidth?: number;
|
|
174
|
+
borderRightWidth?: number;
|
|
175
|
+
borderStartWidth?: number;
|
|
176
|
+
borderTopWidth?: number;
|
|
177
|
+
opacity?: number;
|
|
178
|
+
outlineColor?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").____ColorValue_Internal;
|
|
179
|
+
outlineOffset?: number;
|
|
180
|
+
outlineStyle?: "solid" | "dotted" | "dashed";
|
|
181
|
+
outlineWidth?: number;
|
|
182
|
+
elevation?: number;
|
|
183
|
+
pointerEvents?: "auto" | "none" | "box-none" | "box-only";
|
|
184
|
+
cursor?: import("react-native").CursorValue;
|
|
185
|
+
boxShadow?: ReadonlyArray<import("react-native").BoxShadowValue> | string;
|
|
186
|
+
filter?: ReadonlyArray<import("react-native").FilterFunction> | string;
|
|
187
|
+
mixBlendMode?: "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten" | "color-dodge" | "color-burn" | "hard-light" | "soft-light" | "difference" | "exclusion" | "hue" | "saturation" | "color" | "luminosity";
|
|
188
|
+
experimental_backgroundImage?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundImageValue> | string;
|
|
189
|
+
experimental_backgroundSize?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundSizeValue> | string;
|
|
190
|
+
experimental_backgroundPosition?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundPositionValue> | string;
|
|
191
|
+
experimental_backgroundRepeat?: ReadonlyArray<import("react-native/types_generated/Libraries/StyleSheet/StyleSheetTypes").BackgroundRepeatValue> | string;
|
|
192
|
+
isolation?: "auto" | "isolate";
|
|
193
|
+
}>, never>>, never> & Omit<Readonly<{}>, never>>> | undefined;
|
|
194
|
+
};
|
|
195
|
+
export declare function BuzzvilNativeAdView(props: BuzzvilNativeAdViewProps): import("react").JSX.Element;
|
|
196
|
+
//# sourceMappingURL=BuzzvilNativeAdView.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuzzvilNativeAdView.native.d.ts","sourceRoot":"","sources":["../../../src/BuzzvilNativeAdView.native.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAU,CAAC;AACzC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAS,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,CAAC;AAIzB,wBAAgB,aAAa,CAAC,KAAK,EAAE,wBAAwB;;qBAcjD;QAAE,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;qBAIlD;QAAE,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;;;qBASlD;QAAE,WAAW,EAAE;YAAE,OAAO,EAAE,OAAO,CAAA;SAAE,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa8zvB,CAAC;kBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAVp4vB;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,+BAOlE"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ViewProps } from 'react-native';
|
|
2
|
+
import type { CodegenTypes } from 'react-native';
|
|
3
|
+
type AdLoadedEvent = Readonly<{
|
|
4
|
+
width: CodegenTypes.Double;
|
|
5
|
+
height: CodegenTypes.Double;
|
|
6
|
+
}>;
|
|
7
|
+
type AdFailedEvent = Readonly<{
|
|
8
|
+
code: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}>;
|
|
11
|
+
type RewardedEvent = Readonly<{
|
|
12
|
+
success: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export interface NativeProps extends ViewProps {
|
|
15
|
+
unitId: string;
|
|
16
|
+
layout?: string;
|
|
17
|
+
onAdLoaded?: CodegenTypes.DirectEventHandler<AdLoadedEvent>;
|
|
18
|
+
onAdFailed?: CodegenTypes.DirectEventHandler<AdFailedEvent>;
|
|
19
|
+
onAdClicked?: CodegenTypes.DirectEventHandler<Readonly<{}>>;
|
|
20
|
+
onImpressed?: CodegenTypes.DirectEventHandler<Readonly<{}>>;
|
|
21
|
+
onRewarded?: CodegenTypes.DirectEventHandler<RewardedEvent>;
|
|
22
|
+
}
|
|
23
|
+
declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
24
|
+
export default _default;
|
|
25
|
+
//# sourceMappingURL=BuzzvilNativeAdViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BuzzvilNativeAdViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/BuzzvilNativeAdViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,KAAK,aAAa,GAAG,QAAQ,CAAC;IAC5B,KAAK,EAAE,YAAY,CAAC,MAAM,CAAC;IAC3B,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC;CAC7B,CAAC,CAAC;AACH,KAAK,aAAa,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AACjE,KAAK,aAAa,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAEpD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC5D,UAAU,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IAC5D,UAAU,CAAC,EAAE,YAAY,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC7D;;AAED,wBAA0E"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type TurboModule } from 'react-native';
|
|
2
|
+
/**
|
|
3
|
+
* TurboModule spec for the native `Buzzvil` module — a thin bridge over
|
|
4
|
+
* Buzzvil's BuzzBenefit v6 SDKs (Android / iOS).
|
|
5
|
+
*
|
|
6
|
+
* This file is the **source of truth**: codegen generates the native
|
|
7
|
+
* interfaces from it. The codegen type system is restricted, so the spec
|
|
8
|
+
* intentionally uses **primitives only** — no optional fields, no object
|
|
9
|
+
* params, no enums/unions. Friendly types (optional fields, the `'MALE' |
|
|
10
|
+
* 'FEMALE'` gender union) live in `./types` and are applied in the JS
|
|
11
|
+
* wrapper (`./buzzvil.native.tsx`).
|
|
12
|
+
*
|
|
13
|
+
* ## Sentinel contract (MUST be interpreted identically by both native impls)
|
|
14
|
+
*
|
|
15
|
+
* Because the spec has no optionals, the JS wrapper encodes "not provided"
|
|
16
|
+
* as sentinel values. `BuzzvilModule.kt` and `Buzzvil.mm` must treat them
|
|
17
|
+
* the same way or the platforms will silently diverge:
|
|
18
|
+
*
|
|
19
|
+
* - `gender`: `'MALE'` or `'FEMALE'`. **Empty string `''` → do not set gender**
|
|
20
|
+
* (pass `null` to the native user builder).
|
|
21
|
+
* - `birthYear`: a 4-digit year. **`0` → do not set birth year** (pass `null`).
|
|
22
|
+
* - `routePath`: a BenefitHub page number from the Buzzvil admin. **`''` → no
|
|
23
|
+
* route path** (open the default hub page).
|
|
24
|
+
* - `showHistory`: `true` → open the BenefitHub history/earnings page
|
|
25
|
+
* (Android `BuzzBenefitHubPage.HISTORY` / iOS `.history` query params).
|
|
26
|
+
*/
|
|
27
|
+
export interface Spec extends TurboModule {
|
|
28
|
+
/**
|
|
29
|
+
* Initialize the BuzzBenefit SDK with the app's Buzzvil app id.
|
|
30
|
+
*
|
|
31
|
+
* - iOS: `BuzzBenefit.shared.initialize(with: BuzzBenefitConfig.Builder(appId:).build())`.
|
|
32
|
+
* - Android: `BuzzvilSdk.initialize(application, BuzzBenefitConfig.Builder(appId).build())`.
|
|
33
|
+
*
|
|
34
|
+
* NOTE (verify at native-impl time): the Android SDK initializes with the
|
|
35
|
+
* `Application` instance and the docs recommend `Application.onCreate()`
|
|
36
|
+
* timing. JS-driven init must pass `reactContext.applicationContext as
|
|
37
|
+
* Application` and run before any `login`/`showBenefitHub` call. If the
|
|
38
|
+
* Android SDK turns out to require manifest/Application-level setup (as the
|
|
39
|
+
* AdPopcorn wrapper's `setAppKey` does), this becomes iOS-effective with an
|
|
40
|
+
* Android no-op — confirm against the running SDK before shipping.
|
|
41
|
+
*/
|
|
42
|
+
initialize(appId: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Log a user into the SDK. Resolves on success, rejects on failure.
|
|
45
|
+
*
|
|
46
|
+
* See the sentinel contract above for `gender` / `birthYear`.
|
|
47
|
+
*
|
|
48
|
+
* - iOS: `BuzzBenefit.shared.login(with:onSuccess:onFailure:)`.
|
|
49
|
+
* - Android: `BuzzvilSdk.login(BuzzvilSdkUser(...), BuzzvilSdkLoginListener)`.
|
|
50
|
+
*
|
|
51
|
+
* @param userId Non-identifiable, persistent user id. ASCII, max 255 chars.
|
|
52
|
+
* @param gender `'MALE'` | `'FEMALE'` | `''` (unset).
|
|
53
|
+
* @param birthYear 4-digit year, or `0` (unset).
|
|
54
|
+
*/
|
|
55
|
+
login(userId: string, gender: string, birthYear: number): Promise<void>;
|
|
56
|
+
/** Log the current user out. iOS/Android: `logout()`. */
|
|
57
|
+
logout(): void;
|
|
58
|
+
/** Whether a user is currently logged in. iOS `isLoggedIn()` / Android `isLoggedIn`. */
|
|
59
|
+
isLoggedIn(): Promise<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* Present the BenefitHub (offerwall) over the current screen.
|
|
62
|
+
*
|
|
63
|
+
* - iOS: `BuzzBenefitHub().show(on: currentViewController)`.
|
|
64
|
+
* - Android: `BuzzBenefitHub.show(currentActivity, config)`.
|
|
65
|
+
*
|
|
66
|
+
* See the sentinel contract above for `routePath` / `showHistory`.
|
|
67
|
+
*/
|
|
68
|
+
showBenefitHub(routePath: string, showHistory: boolean): void;
|
|
69
|
+
}
|
|
70
|
+
declare const _default: Spec;
|
|
71
|
+
export default _default;
|
|
72
|
+
//# sourceMappingURL=NativeBuzzvil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeBuzzvil.d.ts","sourceRoot":"","sources":["../../../src/NativeBuzzvil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAErE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE,yDAAyD;IACzD,MAAM,IAAI,IAAI,CAAC;IAEf,wFAAwF;IACxF,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAE/B;;;;;;;OAOG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/D;;AAED,wBAAiE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BuzzvilUser, BenefitHubOptions } from './types.js';
|
|
2
|
+
export declare function initialize(_appId: string): void;
|
|
3
|
+
export declare function login(_user: BuzzvilUser): Promise<void>;
|
|
4
|
+
export declare function logout(): void;
|
|
5
|
+
export declare function isLoggedIn(): Promise<boolean>;
|
|
6
|
+
export declare function showBenefitHub(_options?: BenefitHubOptions): void;
|
|
7
|
+
//# sourceMappingURL=buzzvil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buzzvil.d.ts","sourceRoot":"","sources":["../../../src/buzzvil.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAS,CAAC;AAU9D,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvD;AAED,wBAAgB,MAAM,IAAI,IAAI,CAE7B;AAED,wBAAgB,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC,CAE7C;AAED,wBAAgB,cAAc,CAAC,QAAQ,GAAE,iBAAsB,GAAG,IAAI,CAErE"}
|