novvy-ads-react-native 1.0.0-beta.1

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 (149) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +210 -0
  3. package/android/build.gradle +84 -0
  4. package/android/gradle.properties +4 -0
  5. package/android/src/main/AndroidManifest.xml +4 -0
  6. package/android/src/main/java/ai/novvy/reactnative/NovvyAdContainerView.kt +63 -0
  7. package/android/src/main/java/ai/novvy/reactnative/NovvyAdsModule.kt +390 -0
  8. package/android/src/main/java/ai/novvy/reactnative/NovvyAdsPackage.kt +46 -0
  9. package/android/src/main/java/ai/novvy/reactnative/NovvyPauseAdViewManager.kt +68 -0
  10. package/android/src/main/java/ai/novvy/reactnative/NovvyScrollAdViewManager.kt +72 -0
  11. package/android/src/main/java/ai/novvy/reactnative/RnPlayerAdapter.kt +18 -0
  12. package/android/src/main/java/ai/novvy/reactnative/ViewReadyEvent.kt +26 -0
  13. package/app.plugin.js +4 -0
  14. package/ios/NovvyAds.mm +168 -0
  15. package/ios/NovvyAdsImpl.swift +409 -0
  16. package/ios/NovvyPauseAdView.mm +79 -0
  17. package/ios/NovvyScrollAdView.mm +80 -0
  18. package/ios/RnPlayerAdapter.swift +14 -0
  19. package/lib/commonjs/NovvyAds.js +87 -0
  20. package/lib/commonjs/NovvyAds.js.map +1 -0
  21. package/lib/commonjs/ads/NovvyAd.js +121 -0
  22. package/lib/commonjs/ads/NovvyAd.js.map +1 -0
  23. package/lib/commonjs/ads/NovvyEndAd.js +19 -0
  24. package/lib/commonjs/ads/NovvyEndAd.js.map +1 -0
  25. package/lib/commonjs/ads/NovvyFullScreenAd.js +49 -0
  26. package/lib/commonjs/ads/NovvyFullScreenAd.js.map +1 -0
  27. package/lib/commonjs/ads/NovvyInterstitialAd.js +19 -0
  28. package/lib/commonjs/ads/NovvyInterstitialAd.js.map +1 -0
  29. package/lib/commonjs/ads/NovvyMidAd.js +19 -0
  30. package/lib/commonjs/ads/NovvyMidAd.js.map +1 -0
  31. package/lib/commonjs/ads/NovvyPauseAd.js +116 -0
  32. package/lib/commonjs/ads/NovvyPauseAd.js.map +1 -0
  33. package/lib/commonjs/ads/NovvyRewardedAd.js +53 -0
  34. package/lib/commonjs/ads/NovvyRewardedAd.js.map +1 -0
  35. package/lib/commonjs/ads/NovvyScrollAd.js +136 -0
  36. package/lib/commonjs/ads/NovvyScrollAd.js.map +1 -0
  37. package/lib/commonjs/eventBus.js +60 -0
  38. package/lib/commonjs/eventBus.js.map +1 -0
  39. package/lib/commonjs/index.js +90 -0
  40. package/lib/commonjs/index.js.map +1 -0
  41. package/lib/commonjs/package.json +1 -0
  42. package/lib/commonjs/spec/NativeNovvyAds.js +27 -0
  43. package/lib/commonjs/spec/NativeNovvyAds.js.map +1 -0
  44. package/lib/commonjs/spec/NovvyPauseAdViewNativeComponent.js +16 -0
  45. package/lib/commonjs/spec/NovvyPauseAdViewNativeComponent.js.map +1 -0
  46. package/lib/commonjs/spec/NovvyScrollAdViewNativeComponent.js +17 -0
  47. package/lib/commonjs/spec/NovvyScrollAdViewNativeComponent.js.map +1 -0
  48. package/lib/commonjs/spec/codegen-event-emitter.d.js +2 -0
  49. package/lib/commonjs/spec/codegen-event-emitter.d.js.map +1 -0
  50. package/lib/commonjs/types.js +54 -0
  51. package/lib/commonjs/types.js.map +1 -0
  52. package/lib/commonjs/views/NovvyPauseAdView.js +76 -0
  53. package/lib/commonjs/views/NovvyPauseAdView.js.map +1 -0
  54. package/lib/commonjs/views/NovvyScrollAdView.js +63 -0
  55. package/lib/commonjs/views/NovvyScrollAdView.js.map +1 -0
  56. package/lib/module/NovvyAds.js +83 -0
  57. package/lib/module/NovvyAds.js.map +1 -0
  58. package/lib/module/ads/NovvyAd.js +117 -0
  59. package/lib/module/ads/NovvyAd.js.map +1 -0
  60. package/lib/module/ads/NovvyEndAd.js +15 -0
  61. package/lib/module/ads/NovvyEndAd.js.map +1 -0
  62. package/lib/module/ads/NovvyFullScreenAd.js +45 -0
  63. package/lib/module/ads/NovvyFullScreenAd.js.map +1 -0
  64. package/lib/module/ads/NovvyInterstitialAd.js +15 -0
  65. package/lib/module/ads/NovvyInterstitialAd.js.map +1 -0
  66. package/lib/module/ads/NovvyMidAd.js +15 -0
  67. package/lib/module/ads/NovvyMidAd.js.map +1 -0
  68. package/lib/module/ads/NovvyPauseAd.js +112 -0
  69. package/lib/module/ads/NovvyPauseAd.js.map +1 -0
  70. package/lib/module/ads/NovvyRewardedAd.js +49 -0
  71. package/lib/module/ads/NovvyRewardedAd.js.map +1 -0
  72. package/lib/module/ads/NovvyScrollAd.js +132 -0
  73. package/lib/module/ads/NovvyScrollAd.js.map +1 -0
  74. package/lib/module/eventBus.js +55 -0
  75. package/lib/module/eventBus.js.map +1 -0
  76. package/lib/module/index.js +22 -0
  77. package/lib/module/index.js.map +1 -0
  78. package/lib/module/package.json +1 -0
  79. package/lib/module/spec/NativeNovvyAds.js +28 -0
  80. package/lib/module/spec/NativeNovvyAds.js.map +1 -0
  81. package/lib/module/spec/NovvyPauseAdViewNativeComponent.js +13 -0
  82. package/lib/module/spec/NovvyPauseAdViewNativeComponent.js.map +1 -0
  83. package/lib/module/spec/NovvyScrollAdViewNativeComponent.js +14 -0
  84. package/lib/module/spec/NovvyScrollAdViewNativeComponent.js.map +1 -0
  85. package/lib/module/spec/codegen-event-emitter.d.js +2 -0
  86. package/lib/module/spec/codegen-event-emitter.d.js.map +1 -0
  87. package/lib/module/types.js +56 -0
  88. package/lib/module/types.js.map +1 -0
  89. package/lib/module/views/NovvyPauseAdView.js +70 -0
  90. package/lib/module/views/NovvyPauseAdView.js.map +1 -0
  91. package/lib/module/views/NovvyScrollAdView.js +57 -0
  92. package/lib/module/views/NovvyScrollAdView.js.map +1 -0
  93. package/lib/typescript/NovvyAds.d.ts +69 -0
  94. package/lib/typescript/NovvyAds.d.ts.map +1 -0
  95. package/lib/typescript/ads/NovvyAd.d.ts +57 -0
  96. package/lib/typescript/ads/NovvyAd.d.ts.map +1 -0
  97. package/lib/typescript/ads/NovvyEndAd.d.ts +7 -0
  98. package/lib/typescript/ads/NovvyEndAd.d.ts.map +1 -0
  99. package/lib/typescript/ads/NovvyFullScreenAd.d.ts +19 -0
  100. package/lib/typescript/ads/NovvyFullScreenAd.d.ts.map +1 -0
  101. package/lib/typescript/ads/NovvyInterstitialAd.d.ts +7 -0
  102. package/lib/typescript/ads/NovvyInterstitialAd.d.ts.map +1 -0
  103. package/lib/typescript/ads/NovvyMidAd.d.ts +7 -0
  104. package/lib/typescript/ads/NovvyMidAd.d.ts.map +1 -0
  105. package/lib/typescript/ads/NovvyPauseAd.d.ts +45 -0
  106. package/lib/typescript/ads/NovvyPauseAd.d.ts.map +1 -0
  107. package/lib/typescript/ads/NovvyRewardedAd.d.ts +19 -0
  108. package/lib/typescript/ads/NovvyRewardedAd.d.ts.map +1 -0
  109. package/lib/typescript/ads/NovvyScrollAd.d.ts +57 -0
  110. package/lib/typescript/ads/NovvyScrollAd.d.ts.map +1 -0
  111. package/lib/typescript/eventBus.d.ts +15 -0
  112. package/lib/typescript/eventBus.d.ts.map +1 -0
  113. package/lib/typescript/index.d.ts +15 -0
  114. package/lib/typescript/index.d.ts.map +1 -0
  115. package/lib/typescript/spec/NativeNovvyAds.d.ts +73 -0
  116. package/lib/typescript/spec/NativeNovvyAds.d.ts.map +1 -0
  117. package/lib/typescript/spec/NovvyPauseAdViewNativeComponent.d.ts +18 -0
  118. package/lib/typescript/spec/NovvyPauseAdViewNativeComponent.d.ts.map +1 -0
  119. package/lib/typescript/spec/NovvyScrollAdViewNativeComponent.d.ts +19 -0
  120. package/lib/typescript/spec/NovvyScrollAdViewNativeComponent.d.ts.map +1 -0
  121. package/lib/typescript/types.d.ts +77 -0
  122. package/lib/typescript/types.d.ts.map +1 -0
  123. package/lib/typescript/views/NovvyPauseAdView.d.ts +21 -0
  124. package/lib/typescript/views/NovvyPauseAdView.d.ts.map +1 -0
  125. package/lib/typescript/views/NovvyScrollAdView.d.ts +22 -0
  126. package/lib/typescript/views/NovvyScrollAdView.d.ts.map +1 -0
  127. package/novvy-ads-react-native.podspec +71 -0
  128. package/package.json +84 -0
  129. package/plugin/build/index.d.ts +11 -0
  130. package/plugin/build/index.js +53 -0
  131. package/react-native.config.js +7 -0
  132. package/src/NovvyAds.ts +98 -0
  133. package/src/ads/NovvyAd.ts +125 -0
  134. package/src/ads/NovvyEndAd.ts +13 -0
  135. package/src/ads/NovvyFullScreenAd.ts +46 -0
  136. package/src/ads/NovvyInterstitialAd.ts +13 -0
  137. package/src/ads/NovvyMidAd.ts +13 -0
  138. package/src/ads/NovvyPauseAd.ts +125 -0
  139. package/src/ads/NovvyRewardedAd.ts +49 -0
  140. package/src/ads/NovvyScrollAd.ts +138 -0
  141. package/src/eventBus.ts +59 -0
  142. package/src/index.tsx +29 -0
  143. package/src/spec/NativeNovvyAds.ts +134 -0
  144. package/src/spec/NovvyPauseAdViewNativeComponent.ts +20 -0
  145. package/src/spec/NovvyScrollAdViewNativeComponent.ts +21 -0
  146. package/src/spec/codegen-event-emitter.d.ts +10 -0
  147. package/src/types.ts +82 -0
  148. package/src/views/NovvyPauseAdView.tsx +80 -0
  149. package/src/views/NovvyScrollAdView.tsx +71 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovvyRewardedAd.d.ts","sourceRoot":"","sources":["../../../src/ads/NovvyRewardedAd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,2BAA2B;AAC3B,qBAAa,eAAgB,SAAQ,OAAO;IAC1C,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAEhC,SAAS,CAAC,WAAW,IAAI,IAAI;IAI7B,uEAAuE;IACvE,IAAI,IAAI,IAAI;IAOZ,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAmB3D"}
@@ -0,0 +1,57 @@
1
+ import type { NativeAdEvent } from '../spec/NativeNovvyAds';
2
+ import { NovvyAd } from './NovvyAd';
3
+ /**
4
+ * A scroll ad that renders as a native view inserted into a scrollable list.
5
+ *
6
+ * Lifecycle: {@link load} → embed `<NovvyScrollAdView>` → {@link setPlaying} as
7
+ * it enters / leaves the viewport → {@link destroy}. Attach/detach are driven
8
+ * by the `<NovvyScrollAdView>` component's mount lifecycle.
9
+ */
10
+ export declare class NovvyScrollAd extends NovvyAd {
11
+ /** The Fabric component name used by `<NovvyScrollAdView>`. */
12
+ static readonly viewType = "NovvyScrollAdView";
13
+ /**
14
+ * Optional override for the episode number used in the bid request. When
15
+ * non-null, takes precedence over the value set via
16
+ * {@link NovvyAds.setContentContext}.
17
+ */
18
+ readonly episodeNumber?: number | null;
19
+ /** Called when the ad becomes visible in the viewport. */
20
+ onAdShowed?: () => void;
21
+ /** Called when the ad is hidden / removed from the viewport. */
22
+ onAdHidden?: () => void;
23
+ /**
24
+ * Called every second during playback with the remaining seconds
25
+ * (0 = user can swipe past the ad).
26
+ */
27
+ onAdPlaybackTick?: (remainingSeconds: number) => void;
28
+ constructor(adUnitId: string, episodeNumber?: number | null);
29
+ private _viewReady;
30
+ private _attached;
31
+ /** Last play intent from the host; (re)applied on each attach. */
32
+ private _playing;
33
+ private _durationSeconds;
34
+ private _useDefaultSwipeOverlay;
35
+ protected _loadNative(): void;
36
+ /**
37
+ * Signals that the native container is ready (fired automatically by
38
+ * `<NovvyScrollAdView>` on `onViewReady`). Records the attach params and
39
+ * mounts the ad once it has also finished loading.
40
+ */
41
+ attach(durationSeconds?: number | null, useDefaultSwipeOverlay?: boolean): void;
42
+ /** Detach the scroll ad from its container. */
43
+ detach(): void;
44
+ /**
45
+ * Set the playing state. Call `setPlaying(true)` when the item scrolls into
46
+ * the viewport and `setPlaying(false)` when it scrolls out. Safe to call
47
+ * before the ad has attached — the intent is buffered and applied on attach.
48
+ */
49
+ setPlaying(playing: boolean): void;
50
+ /**
51
+ * Attach once the ad is loaded AND the native view is ready — the native
52
+ * engine requires load-before-attach and does not retry, so we gate on both.
53
+ */
54
+ private _maybeAttach;
55
+ protected _handleInternalEvent(event: NativeAdEvent): void;
56
+ }
57
+ //# sourceMappingURL=NovvyScrollAd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovvyScrollAd.d.ts","sourceRoot":"","sources":["../../../src/ads/NovvyScrollAd.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;GAMG;AACH,qBAAa,aAAc,SAAQ,OAAO;IACxC,+DAA+D;IAC/D,MAAM,CAAC,QAAQ,CAAC,QAAQ,uBAAuB;IAE/C;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvC,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,CAAC,gBAAgB,EAAE,MAAM,KAAK,IAAI,CAAC;gBAE1C,QAAQ,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI;IAmB3D,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,SAAS,CAAS;IAC1B,kEAAkE;IAClE,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAuB;IAC/C,OAAO,CAAC,uBAAuB,CAAQ;IAEvC,SAAS,CAAC,WAAW,IAAI,IAAI;IAI7B;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,sBAAsB,UAAO,GAAG,IAAI;IAO5E,+CAA+C;IAC/C,MAAM,IAAI,IAAI;IAMd;;;;OAIG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAOlC;;;OAGG;IACH,OAAO,CAAC,YAAY;IAgBpB,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAuB3D"}
@@ -0,0 +1,15 @@
1
+ import type { NativeAdEvent } from './spec/NativeNovvyAds';
2
+ /**
3
+ * Central hub over the single native→JS `onAdEvent` stream.
4
+ *
5
+ * Mirrors the Flutter plugin's `_NovvyAdsImpl` broadcast stream: one native
6
+ * event source is fanned out to per-ad handlers filtered by `adObjectId`.
7
+ */
8
+ export type AdEventHandler = (event: NativeAdEvent) => void;
9
+ /**
10
+ * Subscribe to events for a single ad instance. Returns an unsubscribe fn.
11
+ */
12
+ export declare function subscribe(adObjectId: string, handler: AdEventHandler): () => void;
13
+ /** The underlying TurboModule instance. */
14
+ export declare const Native: import("./spec/NativeNovvyAds").Spec;
15
+ //# sourceMappingURL=eventBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../../src/eventBus.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;GAKG;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;AAqB5D;;GAEG;AACH,wBAAgB,SAAS,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,MAAM,IAAI,CAkBZ;AAED,2CAA2C;AAC3C,eAAO,MAAM,MAAM,sCAAiB,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { NovvyAds } from './NovvyAds';
2
+ export { NovvyAd } from './ads/NovvyAd';
3
+ export { NovvyFullScreenAd } from './ads/NovvyFullScreenAd';
4
+ export { NovvyInterstitialAd } from './ads/NovvyInterstitialAd';
5
+ export { NovvyRewardedAd } from './ads/NovvyRewardedAd';
6
+ export { NovvyMidAd } from './ads/NovvyMidAd';
7
+ export { NovvyEndAd } from './ads/NovvyEndAd';
8
+ export { NovvyScrollAd } from './ads/NovvyScrollAd';
9
+ export { NovvyPauseAd } from './ads/NovvyPauseAd';
10
+ export { NovvyScrollAdView } from './views/NovvyScrollAdView';
11
+ export type { NovvyScrollAdViewProps } from './views/NovvyScrollAdView';
12
+ export { NovvyPauseAdView } from './views/NovvyPauseAdView';
13
+ export type { NovvyPauseAdViewProps } from './views/NovvyPauseAdView';
14
+ export { NovvyAdEvent, type NovvyUserContext, type NovvyContentContext, type NovvyDramaRecord, type NovvyGender, type NovvyPlayerAdapter, } from './types';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,YAAY,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EACL,YAAY,EACZ,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,73 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import type { Int32, Double, EventEmitter, UnsafeObject } from 'react-native/Libraries/Types/CodegenTypes';
3
+ /**
4
+ * Codegen-facing spec for the Novvy Ads TurboModule (new architecture only).
5
+ *
6
+ * Method surface mirrors the Flutter plugin's Pigeon `NovvyAdHostApi`
7
+ * (pigeons/novvy_ads_api.dart) one-to-one. The single `onAdEvent` emitter
8
+ * mirrors Pigeon's `NovvyAdsFlutterApi.onAdEvent`; each JS ad object filters
9
+ * this stream by its own `adObjectId`.
10
+ *
11
+ * NOTE: Codegen struct/event types must live in this file. The public,
12
+ * richly-documented aliases are re-exported from `../types`.
13
+ */
14
+ export type NativeDramaRecord = {
15
+ seriesId: string;
16
+ lastWatchedEpisode: Int32;
17
+ unlockedEpisode: Int32;
18
+ dramaTitle?: string | null;
19
+ };
20
+ export type NativeUserContext = {
21
+ userId?: string | null;
22
+ hashedEmail?: string | null;
23
+ isPaidUser?: boolean | null;
24
+ age?: Int32 | null;
25
+ /** "male" / "female" / "unknown". */
26
+ gender?: string | null;
27
+ dramaWatchHistory?: Array<NativeDramaRecord> | null;
28
+ maximumAdsInOneDrama?: Int32 | null;
29
+ };
30
+ export type NativeContentContext = {
31
+ seriesName?: string | null;
32
+ episodeNumber?: Int32 | null;
33
+ url?: string | null;
34
+ };
35
+ /**
36
+ * Single native→JS ad lifecycle event. `event` is one of the NovvyAdEvent
37
+ * string values. `remainingSeconds` is only populated for `playbackTick`
38
+ * (flattened from Pigeon's `data` map for codegen compatibility).
39
+ */
40
+ export type NativeAdEvent = {
41
+ adObjectId: string;
42
+ adUnitId: string;
43
+ event: string;
44
+ error?: string | null;
45
+ remainingSeconds?: Int32 | null;
46
+ };
47
+ export interface Spec extends TurboModule {
48
+ initialize(appId: string, endpoint: string, apiKey: string, userContext?: UnsafeObject | null): Promise<boolean>;
49
+ setUserContext(context: UnsafeObject): void;
50
+ updateUserContext(partial: UnsafeObject): void;
51
+ setContentContext(context: UnsafeObject): void;
52
+ updateContentContext(partial: UnsafeObject): void;
53
+ loadInterstitialAd(adUnitId: string, adObjectId: string): void;
54
+ showInterstitialAd(adObjectId: string): void;
55
+ loadRewardedAd(adUnitId: string, adObjectId: string): void;
56
+ showRewardedAd(adObjectId: string): void;
57
+ loadMidAd(adUnitId: string, adObjectId: string): void;
58
+ showMidAd(adObjectId: string): void;
59
+ loadEndAd(adUnitId: string, adObjectId: string): void;
60
+ showEndAd(adObjectId: string): void;
61
+ loadScrollAd(adUnitId: string, adObjectId: string, episodeNumber?: Int32 | null): void;
62
+ attachScrollAd(adObjectId: string, durationSeconds: Int32 | null, useDefaultSwipeOverlay: boolean): void;
63
+ setScrollAdPlaying(adObjectId: string, playing: boolean): void;
64
+ detachScrollAd(adObjectId: string): void;
65
+ attachPauseAd(adUnitId: string, adObjectId: string, positionMs: Double, isPlaying: boolean): void;
66
+ updatePauseAdPlayerState(adObjectId: string, positionMs: Double, isPlaying: boolean): void;
67
+ detachPauseAd(adObjectId: string): void;
68
+ disposeAd(adObjectId: string): void;
69
+ readonly onAdEvent: EventEmitter<NativeAdEvent>;
70
+ }
71
+ declare const _default: Spec;
72
+ export default _default;
73
+ //# sourceMappingURL=NativeNovvyAds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeNovvyAds.d.ts","sourceRoot":"","sources":["../../../src/spec/NativeNovvyAds.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
+ /**
4
+ * Fabric component for an inline realtime pause-card ad container
5
+ * (fixed 260×90). The native view registers its container in the TurboModule
6
+ * keyed by `adObjectId`, then fires `onViewReady`, at which point JS issues
7
+ * `attachPauseAd` (there is no load step for pause ads).
8
+ */
9
+ type ViewReadyEvent = Readonly<{
10
+ adObjectId: string;
11
+ }>;
12
+ export interface NativeProps extends ViewProps {
13
+ adObjectId: string;
14
+ onViewReady?: DirectEventHandler<ViewReadyEvent>;
15
+ }
16
+ declare const _default: HostComponent<NativeProps>;
17
+ export default _default;
18
+ //# sourceMappingURL=NovvyPauseAdViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovvyPauseAdViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/spec/NovvyPauseAdViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF;;;;;GAKG;AACH,KAAK,cAAc,GAAG,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAClD;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
@@ -0,0 +1,19 @@
1
+ import type { HostComponent, ViewProps } from 'react-native';
2
+ import type { DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
3
+ /**
4
+ * Fabric component for an inline scroll (feed) ad container.
5
+ *
6
+ * The native view registers its container in the TurboModule keyed by
7
+ * `adObjectId`, then fires `onViewReady` (mirrors the Flutter plugin's
8
+ * `onPlatformViewCreated`), at which point JS issues `attachScrollAd`.
9
+ */
10
+ type ViewReadyEvent = Readonly<{
11
+ adObjectId: string;
12
+ }>;
13
+ export interface NativeProps extends ViewProps {
14
+ adObjectId: string;
15
+ onViewReady?: DirectEventHandler<ViewReadyEvent>;
16
+ }
17
+ declare const _default: HostComponent<NativeProps>;
18
+ export default _default;
19
+ //# sourceMappingURL=NovvyScrollAdViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovvyScrollAdViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/spec/NovvyScrollAdViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAEpF;;;;;;GAMG;AACH,KAAK,cAAc,GAAG,QAAQ,CAAC;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEvD,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC,cAAc,CAAC,CAAC;CAClD;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Public types for the Novvy Ads React Native SDK.
3
+ *
4
+ * These mirror the Flutter plugin's Pigeon data classes
5
+ * (pigeons/novvy_ads_api.dart). At runtime they are structurally identical to
6
+ * the codegen structs in `spec/NativeNovvyAds.ts`, so instances pass straight
7
+ * through the TurboModule with no conversion.
8
+ */
9
+ /** A single drama-watch history entry used for ad targeting. */
10
+ export interface NovvyDramaRecord {
11
+ seriesId: string;
12
+ lastWatchedEpisode: number;
13
+ unlockedEpisode: number;
14
+ dramaTitle?: string | null;
15
+ }
16
+ /** User gender values accepted by the SDK. */
17
+ export type NovvyGender = 'male' | 'female' | 'unknown';
18
+ /**
19
+ * User identity and subscription context.
20
+ *
21
+ * Pass to {@link NovvyAds.setUserContext} (full replace) or
22
+ * {@link NovvyAds.updateUserContext} (incremental merge).
23
+ */
24
+ export interface NovvyUserContext {
25
+ userId?: string | null;
26
+ /** SHA-256 of the trimmed/lowercased email. Use {@link NovvyAds.helperHashEmail}. */
27
+ hashedEmail?: string | null;
28
+ isPaidUser?: boolean | null;
29
+ age?: number | null;
30
+ gender?: NovvyGender | null;
31
+ /** Watched-drama records used for targeting. */
32
+ dramaWatchHistory?: NovvyDramaRecord[] | null;
33
+ /** Frequency cap: maximum ads shown within a single drama. */
34
+ maximumAdsInOneDrama?: number | null;
35
+ }
36
+ /**
37
+ * Content and episode context used for ad targeting.
38
+ *
39
+ * Pass to {@link NovvyAds.setContentContext} (full replace) or
40
+ * {@link NovvyAds.updateContentContext} (incremental merge).
41
+ */
42
+ export interface NovvyContentContext {
43
+ seriesName?: string | null;
44
+ episodeNumber?: number | null;
45
+ url?: string | null;
46
+ }
47
+ /** Ad lifecycle event names (mirror Pigeon's `NovvyAdEvent` enum). */
48
+ export declare enum NovvyAdEvent {
49
+ /** Ad and creative are ready to show (not emitted for Pause — realtime). */
50
+ Loaded = "loaded",
51
+ /** Ad failed to load / request. */
52
+ FailedToLoad = "failedToLoad",
53
+ /** Ad was shown (full-screen) or became visible (Scroll / Pause). */
54
+ Showed = "showed",
55
+ /** Full-screen ad was closed by the user (Rewarded / Interstitial / Mid / End). */
56
+ Dismissed = "dismissed",
57
+ /** Inline ad was hidden / removed (Scroll onAdHidden, Pause hidden). */
58
+ Hidden = "hidden",
59
+ /** Rewarded ad earned a reward. Carries no data payload. */
60
+ EarnedReward = "earnedReward",
61
+ /** Scroll ad playback tick. Carries `remainingSeconds`. */
62
+ PlaybackTick = "playbackTick"
63
+ }
64
+ /**
65
+ * Interface for a media player that a {@link NovvyPauseAd} monitors.
66
+ *
67
+ * Implement this to bridge your video/audio player so the SDK can detect
68
+ * playback position and resumption. Mirrors the Flutter plugin's
69
+ * `NovvyPlayerAdapter`.
70
+ */
71
+ export interface NovvyPlayerAdapter {
72
+ /** Current playback position in milliseconds. */
73
+ readonly currentPositionMs: number;
74
+ /** Whether the player is currently playing (not paused/buffering). */
75
+ readonly isPlaying: boolean;
76
+ }
77
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,gEAAgE;AAChE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,8CAA8C;AAC9C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAExD;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAC;IAC9C,8DAA8D;IAC9D,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,sEAAsE;AACtE,oBAAY,YAAY;IACtB,4EAA4E;IAC5E,MAAM,WAAW;IACjB,mCAAmC;IACnC,YAAY,iBAAiB;IAC7B,qEAAqE;IACrE,MAAM,WAAW;IACjB,mFAAmF;IACnF,SAAS,cAAc;IACvB,wEAAwE;IACxE,MAAM,WAAW;IACjB,4DAA4D;IAC5D,YAAY,iBAAiB;IAC7B,2DAA2D;IAC3D,YAAY,iBAAiB;CAC9B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,iDAAiD;IACjD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,sEAAsE;IACtE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC7B"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { type ViewStyle, type StyleProp } from 'react-native';
3
+ import { NovvyPauseAd } from '../ads/NovvyPauseAd';
4
+ import type { NovvyPlayerAdapter } from '../types';
5
+ export interface NovvyPauseAdViewProps {
6
+ /** The pause ad instance (no load step — attach happens on mount). */
7
+ ad: NovvyPauseAd;
8
+ /** Player adapter the SDK monitors to detect resumption. */
9
+ player: NovvyPlayerAdapter;
10
+ style?: StyleProp<ViewStyle>;
11
+ }
12
+ /**
13
+ * Embeds a {@link NovvyPauseAd} as a native view. Fixed to
14
+ * {@link NovvyPauseAd.cardWidth} × {@link NovvyPauseAd.cardHeight}; position it
15
+ * within your own layout. Mirrors the Flutter plugin's `NovvyPauseAdView`.
16
+ *
17
+ * Touch passthrough / opacity follow the card's shown state so the view is
18
+ * transparent and non-interactive until the ad actually appears.
19
+ */
20
+ export declare function NovvyPauseAdView({ ad, player, style, }: NovvyPauseAdViewProps): React.ReactElement;
21
+ //# sourceMappingURL=NovvyPauseAdView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovvyPauseAdView.d.ts","sourceRoot":"","sources":["../../../src/views/NovvyPauseAdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGnD,MAAM,WAAW,qBAAqB;IACpC,sEAAsE;IACtE,EAAE,EAAE,YAAY,CAAC;IACjB,4DAA4D;IAC5D,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,MAAM,EACN,KAAK,GACN,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,CA6C5C"}
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { type ViewStyle, type StyleProp } from 'react-native';
3
+ import type { NovvyScrollAd } from '../ads/NovvyScrollAd';
4
+ export interface NovvyScrollAdViewProps {
5
+ /** The scroll ad instance (load it first via `ad.load()`). */
6
+ ad: NovvyScrollAd;
7
+ /** Swipe-unlock wait time passed to the native attach call. */
8
+ durationSeconds?: number | null;
9
+ /** Whether the SDK renders its built-in "Swipe to skip" pill. */
10
+ useDefaultSwipeOverlay?: boolean;
11
+ style?: StyleProp<ViewStyle>;
12
+ }
13
+ /**
14
+ * Embeds a {@link NovvyScrollAd} as a native view. Wrap it in a container with
15
+ * the desired height for your feed item. Mirrors the Flutter plugin's
16
+ * `NovvyScrollAdView`.
17
+ *
18
+ * A black backdrop paints immediately so the previous page can't show through
19
+ * the slot while the native view is created.
20
+ */
21
+ export declare function NovvyScrollAdView({ ad, durationSeconds, useDefaultSwipeOverlay, style, }: NovvyScrollAdViewProps): React.ReactElement;
22
+ //# sourceMappingURL=NovvyScrollAdView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NovvyScrollAdView.d.ts","sourceRoot":"","sources":["../../../src/views/NovvyScrollAdView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AACjD,OAAO,EAAoB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,MAAM,WAAW,sBAAsB;IACrC,8DAA8D;IAC9D,EAAE,EAAE,aAAa,CAAC;IAClB,+DAA+D;IAC/D,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,iEAAiE;IACjE,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,eAAe,EACf,sBAA6B,EAC7B,KAAK,GACN,EAAE,sBAAsB,GAAG,KAAK,CAAC,YAAY,CAmC7C"}
@@ -0,0 +1,71 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ # Pin the underlying NovvyAds iOS SDK (binary XCFramework) version.
6
+ novvy_ads_sdk_version = "1.1.0"
7
+ release_base = "https://github.com/NovvyAI/novvy-ads-cocoapods/releases/download/v#{novvy_ads_sdk_version}"
8
+
9
+ Pod::Spec.new do |s|
10
+ s.name = "NovvyAdsReactNative"
11
+ s.version = package["version"]
12
+ s.summary = package["description"]
13
+ s.homepage = package["homepage"]
14
+ s.license = package["license"]
15
+ s.authors = package["author"]
16
+
17
+ s.platforms = { :ios => "13.0" }
18
+ s.source = { :git => "https://github.com/NovvyAI/novvy-ads-react-sdk.git", :tag => "#{s.version}" }
19
+ s.swift_version = "5.0"
20
+
21
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
22
+
23
+ # Underlying NovvyAds iOS SDK — vendored binary XCFramework fetched from the
24
+ # cocoapods repo's GitHub Release (mirrors the Flutter plugin's approach so no
25
+ # extra CocoaPods spec source is required by the host).
26
+ s.vendored_frameworks = "NovvyAds.xcframework"
27
+ s.prepare_command = <<-CMD
28
+ set -e
29
+ VERSION_FILE=".novvy_ads_sdk.version"
30
+ # Local-dev escape hatch: when NOVVY_ADS_LOCAL_XCFRAMEWORK is set, skip the
31
+ # GitHub Release download and trust whatever NovvyAds.xcframework already
32
+ # exists in the SDK root (typically a symlink into ../novvy-ads-cocoapods).
33
+ # If the env var holds a path, (re)create the symlink from it first.
34
+ if [ -n "$NOVVY_ADS_LOCAL_XCFRAMEWORK" ]; then
35
+ echo "[NovvyAdsReactNative] NOVVY_ADS_LOCAL_XCFRAMEWORK is set — using local NovvyAds.xcframework."
36
+ case "$NOVVY_ADS_LOCAL_XCFRAMEWORK" in
37
+ 1|true|TRUE|yes|YES) ;;
38
+ *)
39
+ rm -rf NovvyAds.xcframework NovvyAds.xcframework.zip
40
+ ln -s "$NOVVY_ADS_LOCAL_XCFRAMEWORK" NovvyAds.xcframework
41
+ ;;
42
+ esac
43
+ if [ ! -e NovvyAds.xcframework ]; then
44
+ echo "[NovvyAdsReactNative] ERROR: NovvyAds.xcframework not found; symlink or copy it into the SDK root, or set NOVVY_ADS_LOCAL_XCFRAMEWORK to its path." >&2
45
+ exit 1
46
+ fi
47
+ echo "local" > "$VERSION_FILE"
48
+ exit 0
49
+ fi
50
+ if [ "$(cat "$VERSION_FILE" 2>/dev/null)" != "#{novvy_ads_sdk_version}" ]; then
51
+ rm -rf NovvyAds.xcframework NovvyAds.xcframework.zip
52
+ curl -fsSL -o NovvyAds.xcframework.zip "#{release_base}/NovvyAds.xcframework.zip"
53
+ unzip -q NovvyAds.xcframework.zip
54
+ rm -f NovvyAds.xcframework.zip
55
+ echo "#{novvy_ads_sdk_version}" > "$VERSION_FILE"
56
+ fi
57
+ CMD
58
+
59
+ s.pod_target_xcconfig = {
60
+ "DEFINES_MODULE" => "YES",
61
+ # The vendored XCFramework ships arm64 simulator only.
62
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" => "i386 x86_64",
63
+ }
64
+ s.user_target_xcconfig = {
65
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" => "x86_64",
66
+ }
67
+
68
+ # React Native dependencies (React-Core + new-architecture Fabric/TurboModule
69
+ # wiring, folly compiler flags, header search paths). Requires RN >= 0.71.
70
+ install_modules_dependencies(s)
71
+ end
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "novvy-ads-react-native",
3
+ "version": "1.0.0-beta.1",
4
+ "description": "React Native SDK for Novvy Ads — short-drama vertical-video ad formats (interstitial, rewarded, mid, end, scroll, pause) wrapping the native Novvy Android & iOS SDKs.",
5
+ "main": "lib/commonjs/index.js",
6
+ "module": "lib/module/index.js",
7
+ "types": "lib/typescript/index.d.ts",
8
+ "react-native": "src/index.tsx",
9
+ "source": "src/index.tsx",
10
+ "files": [
11
+ "src",
12
+ "lib",
13
+ "android",
14
+ "ios",
15
+ "plugin/build",
16
+ "app.plugin.js",
17
+ "novvy-ads-react-native.podspec",
18
+ "react-native.config.js",
19
+ "!ios/build",
20
+ "!android/build",
21
+ "!android/.gradle",
22
+ "!**/__tests__",
23
+ "!**/__fixtures__",
24
+ "!**/__mocks__"
25
+ ],
26
+ "scripts": {
27
+ "typecheck": "tsc --noEmit",
28
+ "build:plugin": "tsc -p plugin/tsconfig.json",
29
+ "prepare": "bob build && yarn build:plugin"
30
+ },
31
+ "keywords": [
32
+ "react-native",
33
+ "ios",
34
+ "android",
35
+ "ads",
36
+ "novvy",
37
+ "short-drama",
38
+ "rewarded",
39
+ "interstitial"
40
+ ],
41
+ "repository": "https://github.com/NovvyAI/novvy-ads-react-sdk",
42
+ "author": "NovvyAI <dev@novvy.ai>",
43
+ "license": "MIT",
44
+ "homepage": "https://novvy.ai/",
45
+ "peerDependencies": {
46
+ "react": "*",
47
+ "react-native": ">=0.76.0"
48
+ },
49
+ "dependencies": {
50
+ "js-sha256": "^0.11.0"
51
+ },
52
+ "devDependencies": {
53
+ "@expo/config-plugins": "^9.0.0",
54
+ "@react-native/eslint-config": "^0.76.0",
55
+ "@types/react": "^18.2.0",
56
+ "react": "18.3.1",
57
+ "react-native": "0.76.0",
58
+ "react-native-builder-bob": "^0.30.0",
59
+ "typescript": "^5.3.0"
60
+ },
61
+ "codegenConfig": {
62
+ "name": "NovvyAdsSpec",
63
+ "type": "all",
64
+ "jsSrcsDir": "src/spec",
65
+ "android": {
66
+ "javaPackageName": "ai.novvy.reactnative"
67
+ },
68
+ "ios": {
69
+ "componentProvider": {
70
+ "NovvyScrollAdView": "NovvyScrollAdView",
71
+ "NovvyPauseAdView": "NovvyPauseAdView"
72
+ }
73
+ }
74
+ },
75
+ "react-native-builder-bob": {
76
+ "source": "src",
77
+ "output": "lib",
78
+ "targets": [
79
+ "commonjs",
80
+ "module",
81
+ ["typescript", { "project": "tsconfig.build.json" }]
82
+ ]
83
+ }
84
+ }
@@ -0,0 +1,11 @@
1
+ import { type ConfigPlugin } from '@expo/config-plugins';
2
+ export interface NovvyAdsPluginProps {
3
+ /** iOS deployment-target floor written to Podfile.properties (default "13.0"). */
4
+ iosDeploymentTarget?: string;
5
+ /** Android minSdkVersion floor written to gradle.properties (default 24). */
6
+ androidMinSdkVersion?: number;
7
+ /** ATT prompt copy added as NSUserTrackingUsageDescription (iOS). */
8
+ userTrackingUsageDescription?: string;
9
+ }
10
+ declare const _default: ConfigPlugin<void | NovvyAdsPluginProps>;
11
+ export default _default;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config_plugins_1 = require("@expo/config-plugins");
4
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
5
+ const pkg = require('../../package.json');
6
+ const DEFAULT_IOS_TARGET = '13.0';
7
+ const DEFAULT_ANDROID_MIN_SDK = 24;
8
+ /** iOS: raise the Podfile deployment target to at least the SDK floor. */
9
+ const withIosDeploymentTarget = (config, target) => (0, config_plugins_1.withPodfileProperties)(config, (cfg) => {
10
+ var _a;
11
+ const current = parseFloat((_a = cfg.modResults['ios.deploymentTarget']) !== null && _a !== void 0 ? _a : '0');
12
+ if (current < parseFloat(target)) {
13
+ cfg.modResults['ios.deploymentTarget'] = target;
14
+ }
15
+ return cfg;
16
+ });
17
+ /** iOS: optional ATT usage description. */
18
+ const withIosInfoPlist = (config, props) => (0, config_plugins_1.withInfoPlist)(config, (cfg) => {
19
+ if (props.userTrackingUsageDescription) {
20
+ cfg.modResults.NSUserTrackingUsageDescription =
21
+ props.userTrackingUsageDescription;
22
+ }
23
+ return cfg;
24
+ });
25
+ /** Android: raise minSdkVersion to at least the SDK floor. */
26
+ const withAndroidMinSdk = (config, minSdk) => (0, config_plugins_1.withGradleProperties)(config, (cfg) => {
27
+ const key = 'android.minSdkVersion';
28
+ const existing = cfg.modResults.find((item) => item.type === 'property' && item.key === key);
29
+ if (!existing) {
30
+ cfg.modResults.push({ type: 'property', key, value: String(minSdk) });
31
+ }
32
+ else if (Number(existing.value) < minSdk) {
33
+ existing.value = String(minSdk);
34
+ }
35
+ return cfg;
36
+ });
37
+ /**
38
+ * Expo config plugin for `novvy-ads-react-native`.
39
+ *
40
+ * Build-time only — it adds no runtime dependency. Non-Expo hosts don't need
41
+ * it (autolinking + the podspec/gradle already wire the native SDK); Expo hosts
42
+ * run it during `prebuild` to inject the min platform versions and optional
43
+ * ATT configuration.
44
+ */
45
+ const withNovvyAds = (config, props) => {
46
+ var _a, _b;
47
+ const options = props !== null && props !== void 0 ? props : {};
48
+ config = withIosDeploymentTarget(config, (_a = options.iosDeploymentTarget) !== null && _a !== void 0 ? _a : DEFAULT_IOS_TARGET);
49
+ config = withIosInfoPlist(config, options);
50
+ config = withAndroidMinSdk(config, (_b = options.androidMinSdkVersion) !== null && _b !== void 0 ? _b : DEFAULT_ANDROID_MIN_SDK);
51
+ return config;
52
+ };
53
+ exports.default = (0, config_plugins_1.createRunOncePlugin)(withNovvyAds, pkg.name, pkg.version);
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ dependencies: {
3
+ 'novvy-ads-react-native': {
4
+ root: __dirname,
5
+ },
6
+ },
7
+ };