@omp343/rn-ad-mediation 0.1.3 → 0.1.4

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.
@@ -43,4 +43,8 @@ public abstract class NativeRnAdMediationSpec extends ReactContextBaseJavaModule
43
43
  @ReactMethod
44
44
  @DoNotStrip
45
45
  public abstract void showInterstitial();
46
+
47
+ @ReactMethod
48
+ @DoNotStrip
49
+ public abstract void showRewarded();
46
50
  }
@@ -27,11 +27,17 @@ static facebook::jsi::Value __hostFunction_NativeRnAdMediationSpecJSI_showInters
27
27
  return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "showInterstitial", "()V", args, count, cachedMethodId);
28
28
  }
29
29
 
30
+ static facebook::jsi::Value __hostFunction_NativeRnAdMediationSpecJSI_showRewarded(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
31
+ static jmethodID cachedMethodId = nullptr;
32
+ return static_cast<JavaTurboModule &>(turboModule).invokeJavaMethod(rt, VoidKind, "showRewarded", "()V", args, count, cachedMethodId);
33
+ }
34
+
30
35
  NativeRnAdMediationSpecJSI::NativeRnAdMediationSpecJSI(const JavaTurboModule::InitParams &params)
31
36
  : JavaTurboModule(params) {
32
37
  methodMap_["initialize"] = MethodMetadata {4, __hostFunction_NativeRnAdMediationSpecJSI_initialize};
33
38
  methodMap_["showBanner"] = MethodMetadata {0, __hostFunction_NativeRnAdMediationSpecJSI_showBanner};
34
39
  methodMap_["showInterstitial"] = MethodMetadata {0, __hostFunction_NativeRnAdMediationSpecJSI_showInterstitial};
40
+ methodMap_["showRewarded"] = MethodMetadata {0, __hostFunction_NativeRnAdMediationSpecJSI_showRewarded};
35
41
  }
36
42
 
37
43
  std::shared_ptr<TurboModule> RnAdMediation_ModuleProvider(const std::string &moduleName, const JavaTurboModule::InitParams &params) {
@@ -25,6 +25,7 @@ protected:
25
25
  methodMap_["initialize"] = MethodMetadata {.argCount = 4, .invoker = __initialize};
26
26
  methodMap_["showBanner"] = MethodMetadata {.argCount = 0, .invoker = __showBanner};
27
27
  methodMap_["showInterstitial"] = MethodMetadata {.argCount = 0, .invoker = __showInterstitial};
28
+ methodMap_["showRewarded"] = MethodMetadata {.argCount = 0, .invoker = __showRewarded};
28
29
  }
29
30
 
30
31
  private:
@@ -52,6 +53,13 @@ private:
52
53
  "Expected showInterstitial(...) to have 1 parameters");
53
54
  bridging::callFromJs<void>(rt, &T::showInterstitial, static_cast<NativeRnAdMediationCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
54
55
  }
56
+
57
+ static jsi::Value __showRewarded(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
58
+ static_assert(
59
+ bridging::getParameterCount(&T::showRewarded) == 1,
60
+ "Expected showRewarded(...) to have 1 parameters");
61
+ bridging::callFromJs<void>(rt, &T::showRewarded, static_cast<NativeRnAdMediationCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
62
+ }
55
63
  };
56
64
 
57
65
  } // namespace facebook::react
@@ -4,5 +4,5 @@ import NativeRnAdMediation from "./specs/NativeRnAdMediation.js";
4
4
  export const initialize = (admobAppId, unityGameId, applovinKey, ironsourceKey) => NativeRnAdMediation.initialize(admobAppId, unityGameId, applovinKey, ironsourceKey);
5
5
  export const showBanner = () => NativeRnAdMediation.showBanner();
6
6
  export const showInterstitial = () => NativeRnAdMediation.showInterstitial();
7
- export const showRewarded = () => NativeRnAdMediation.showRewarded(); // ✅ ADD THIS
7
+ export const showRewarded = () => NativeRnAdMediation.showRewarded();
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["NativeRnAdMediation","initialize","admobAppId","unityGameId","applovinKey","ironsourceKey","showBanner","showInterstitial","showRewarded"],"sourceRoot":"..\\..\\src","sources":["index.ts"],"mappings":";;AAAA,OAAOA,mBAAmB,MAAM,gCAA6B;AAE7D,OAAO,MAAMC,UAAU,GAAGA,CACxBC,UAAkB,EAClBC,WAAoB,EACpBC,WAAoB,EACpBC,aAAsB,KAEtBL,mBAAmB,CAACC,UAAU,CAC5BC,UAAU,EACVC,WAAW,EACXC,WAAW,EACXC,aACF,CAAC;AAEH,OAAO,MAAMC,UAAU,GAAGA,CAAA,KACxBN,mBAAmB,CAACM,UAAU,CAAC,CAAC;AAElC,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BP,mBAAmB,CAACO,gBAAgB,CAAC,CAAC;AAExC,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAC1BR,mBAAmB,CAACQ,YAAY,CAAC,CAAC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["NativeRnAdMediation","initialize","admobAppId","unityGameId","applovinKey","ironsourceKey","showBanner","showInterstitial","showRewarded"],"sourceRoot":"..\\..\\src","sources":["index.ts"],"mappings":";;AAAA,OAAOA,mBAAmB,MAAM,gCAA6B;AAE7D,OAAO,MAAMC,UAAU,GAAGA,CACxBC,UAAkB,EAClBC,WAAoB,EACpBC,WAAoB,EACpBC,aAAsB,KAEtBL,mBAAmB,CAACC,UAAU,CAC5BC,UAAU,EACVC,WAAW,EACXC,WAAW,EACXC,aACF,CAAC;AAEH,OAAO,MAAMC,UAAU,GAAGA,CAAA,KACxBN,mBAAmB,CAACM,UAAU,CAAC,CAAC;AAElC,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BP,mBAAmB,CAACO,gBAAgB,CAAC,CAAC;AAExC,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAC1BR,mBAAmB,CAACQ,YAAY,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omp343/rn-ad-mediation",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "React Native ad mediation wrapper",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
package/src/index.ts CHANGED
@@ -20,4 +20,4 @@ export const showInterstitial = () =>
20
20
  NativeRnAdMediation.showInterstitial();
21
21
 
22
22
  export const showRewarded = () =>
23
- NativeRnAdMediation.showRewarded(); // ✅ ADD THIS
23
+ NativeRnAdMediation.showRewarded();
@@ -11,7 +11,7 @@ export interface Spec extends TurboModule {
11
11
 
12
12
  showBanner(): void;
13
13
  showInterstitial(): void;
14
- showRewarded(): void; // ✅ ADD THIS
14
+ showRewarded(): void;
15
15
  }
16
16
 
17
17
  export default TurboModuleRegistry.getEnforcing<Spec>(