@apps-in-toss/native-modules 1.0.1 → 1.0.3
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/dist/index.cjs +107 -29
- package/dist/index.d.cts +464 -138
- package/dist/index.d.ts +464 -138
- package/dist/index.js +84 -7
- package/package.json +2 -2
- package/src/AppsInTossModule/native-event-emitter/appsInTossEvent.ts +2 -0
- package/src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts +10 -0
- package/src/AppsInTossModule/native-event-emitter/index.ts +1 -0
- package/src/AppsInTossModule/native-modules/ads/googleAdMob.ts +158 -167
- package/src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts +363 -0
- package/src/AppsInTossModule/native-modules/ads/types.ts +17 -0
- package/src/AppsInTossModule/native-modules/index.ts +22 -4
package/dist/index.js
CHANGED
|
@@ -12,8 +12,19 @@ var EntryMessageExitedEvent = class extends GraniteEventDefinition {
|
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
// src/AppsInTossModule/native-event-emitter/event-plugins/
|
|
15
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts
|
|
16
16
|
import { GraniteEventDefinition as GraniteEventDefinition2 } from "@granite-js/react-native";
|
|
17
|
+
var HomeIconButtonClickHandleEvent = class extends GraniteEventDefinition2 {
|
|
18
|
+
name = "homeIconButtonClickEvent";
|
|
19
|
+
remove() {
|
|
20
|
+
}
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
22
|
+
listener(_) {
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
27
|
+
import { GraniteEventDefinition as GraniteEventDefinition3 } from "@granite-js/react-native";
|
|
17
28
|
|
|
18
29
|
// src/AppsInTossModule/native-modules/AppsInTossModule.ts
|
|
19
30
|
import { TurboModuleRegistry } from "react-native";
|
|
@@ -48,7 +59,7 @@ import { NativeEventEmitter } from "react-native";
|
|
|
48
59
|
var nativeEventEmitter = new NativeEventEmitter(AppsInTossModuleInstance);
|
|
49
60
|
|
|
50
61
|
// src/AppsInTossModule/native-event-emitter/event-plugins/UpdateLocationEvent.ts
|
|
51
|
-
var UpdateLocationEvent = class extends
|
|
62
|
+
var UpdateLocationEvent = class extends GraniteEventDefinition3 {
|
|
52
63
|
name = "updateLocationEvent";
|
|
53
64
|
subscriptionCount = 0;
|
|
54
65
|
ref = {
|
|
@@ -78,7 +89,7 @@ var UpdateLocationEvent = class extends GraniteEventDefinition2 {
|
|
|
78
89
|
};
|
|
79
90
|
|
|
80
91
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
81
|
-
import { GraniteEventDefinition as
|
|
92
|
+
import { GraniteEventDefinition as GraniteEventDefinition4 } from "@granite-js/react-native";
|
|
82
93
|
|
|
83
94
|
// src/utils/generateUUID.ts
|
|
84
95
|
function generateUUID(placeholder) {
|
|
@@ -135,7 +146,7 @@ var INTERNAL__appBridgeHandler = {
|
|
|
135
146
|
|
|
136
147
|
// src/AppsInTossModule/native-event-emitter/internal/AppBridgeCallbackEvent.ts
|
|
137
148
|
var UNSAFE__nativeEventEmitter = nativeEventEmitter;
|
|
138
|
-
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends
|
|
149
|
+
var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventDefinition4 {
|
|
139
150
|
static INTERNAL__appBridgeSubscription;
|
|
140
151
|
name = "appBridgeCallbackEvent";
|
|
141
152
|
constructor() {
|
|
@@ -165,8 +176,8 @@ var AppBridgeCallbackEvent = class _AppBridgeCallbackEvent extends GraniteEventD
|
|
|
165
176
|
};
|
|
166
177
|
|
|
167
178
|
// src/AppsInTossModule/native-event-emitter/internal/VisibilityChangedByTransparentServiceWebEvent.ts
|
|
168
|
-
import { GraniteEventDefinition as
|
|
169
|
-
var VisibilityChangedByTransparentServiceWebEvent = class extends
|
|
179
|
+
import { GraniteEventDefinition as GraniteEventDefinition5 } from "@granite-js/react-native";
|
|
180
|
+
var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDefinition5 {
|
|
170
181
|
name = "onVisibilityChangedByTransparentServiceWeb";
|
|
171
182
|
subscription = null;
|
|
172
183
|
remove() {
|
|
@@ -194,6 +205,7 @@ var VisibilityChangedByTransparentServiceWebEvent = class extends GraniteEventDe
|
|
|
194
205
|
var appsInTossEvent = new GraniteEvent([
|
|
195
206
|
new UpdateLocationEvent(),
|
|
196
207
|
new EntryMessageExitedEvent(),
|
|
208
|
+
new HomeIconButtonClickHandleEvent(),
|
|
197
209
|
// Internal events
|
|
198
210
|
new AppBridgeCallbackEvent(),
|
|
199
211
|
new VisibilityChangedByTransparentServiceWebEvent()
|
|
@@ -433,6 +445,68 @@ loadAdMobRewardedAd.isSupported = createIsSupported();
|
|
|
433
445
|
showAdMobInterstitialAd.isSupported = createIsSupported();
|
|
434
446
|
showAdMobRewardedAd.isSupported = createIsSupported();
|
|
435
447
|
|
|
448
|
+
// src/AppsInTossModule/native-modules/ads/googleAdMobV2.ts
|
|
449
|
+
import { noop as noop2 } from "es-toolkit";
|
|
450
|
+
function loadAppsInTossAdMob(params) {
|
|
451
|
+
if (!loadAppsInTossAdMob.isSupported()) {
|
|
452
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
453
|
+
return noop2;
|
|
454
|
+
}
|
|
455
|
+
const { onEvent, onError, options } = params;
|
|
456
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("loadAppsInTossAdmob", options, {
|
|
457
|
+
onSuccess: (result) => onEvent({ type: "loaded", data: result }),
|
|
458
|
+
onError
|
|
459
|
+
});
|
|
460
|
+
return unregisterCallbacks;
|
|
461
|
+
}
|
|
462
|
+
function showAppsInTossAdMob(params) {
|
|
463
|
+
if (!showAppsInTossAdMob.isSupported()) {
|
|
464
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
465
|
+
return noop2;
|
|
466
|
+
}
|
|
467
|
+
const { onEvent, onError, options } = params;
|
|
468
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler.invokeAppBridgeMethod("showAppsInTossAdmob", options, {
|
|
469
|
+
onAdClicked: () => {
|
|
470
|
+
onEvent({ type: "clicked" });
|
|
471
|
+
},
|
|
472
|
+
onAdDismissed: () => {
|
|
473
|
+
onEvent({ type: "dismissed" });
|
|
474
|
+
},
|
|
475
|
+
onAdFailedToShow: () => {
|
|
476
|
+
onEvent({ type: "failedToShow" });
|
|
477
|
+
},
|
|
478
|
+
onAdImpression: () => {
|
|
479
|
+
onEvent({ type: "impression" });
|
|
480
|
+
},
|
|
481
|
+
onAdShow: () => {
|
|
482
|
+
onEvent({ type: "show" });
|
|
483
|
+
},
|
|
484
|
+
onUserEarnedReward: (data) => {
|
|
485
|
+
onEvent({ type: "userEarnedReward", data });
|
|
486
|
+
},
|
|
487
|
+
onSuccess: () => onEvent({ type: "requested" }),
|
|
488
|
+
onError
|
|
489
|
+
});
|
|
490
|
+
return unregisterCallbacks;
|
|
491
|
+
}
|
|
492
|
+
var ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION2 = "5.227.0";
|
|
493
|
+
var IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION2 = "5.227.0";
|
|
494
|
+
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
495
|
+
var ENVIRONMENT2 = getOperationalEnvironment();
|
|
496
|
+
function createIsSupported2() {
|
|
497
|
+
return () => {
|
|
498
|
+
if (ENVIRONMENT2 !== "toss") {
|
|
499
|
+
return false;
|
|
500
|
+
}
|
|
501
|
+
return isMinVersionSupported({
|
|
502
|
+
android: ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION2,
|
|
503
|
+
ios: IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION2
|
|
504
|
+
});
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
loadAppsInTossAdMob.isSupported = createIsSupported2();
|
|
508
|
+
showAppsInTossAdMob.isSupported = createIsSupported2();
|
|
509
|
+
|
|
436
510
|
// src/AppsInTossModule/native-modules/checkoutPayment.ts
|
|
437
511
|
async function checkoutPayment(options) {
|
|
438
512
|
return AppsInTossModule.checkoutPayment({ params: options });
|
|
@@ -683,7 +757,9 @@ var GoogleAdMob = {
|
|
|
683
757
|
loadAdMobInterstitialAd,
|
|
684
758
|
showAdMobInterstitialAd,
|
|
685
759
|
loadAdMobRewardedAd,
|
|
686
|
-
showAdMobRewardedAd
|
|
760
|
+
showAdMobRewardedAd,
|
|
761
|
+
loadAppsInTossAdMob,
|
|
762
|
+
showAppsInTossAdMob
|
|
687
763
|
};
|
|
688
764
|
|
|
689
765
|
// src/BedrockModule/native-modules/natives/BedrockModule.ts
|
|
@@ -803,6 +879,7 @@ export {
|
|
|
803
879
|
GoogleAdMob,
|
|
804
880
|
IAP,
|
|
805
881
|
AppsInTossModuleInstance as INTERNAL__AppsInTossModule,
|
|
882
|
+
INTERNAL__appBridgeHandler,
|
|
806
883
|
INTERNAL__module,
|
|
807
884
|
Storage,
|
|
808
885
|
TossPay,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apps-in-toss/native-modules",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"description": "Native Modules for Apps In Toss",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"prepack": "yarn build",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "380ad5f697a176bcc6adae409153fa43e700d053"
|
|
57
57
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GraniteEvent } from '@granite-js/react-native';
|
|
2
2
|
import { EntryMessageExitedEvent } from './event-plugins/EntryMessageExitedEvent';
|
|
3
|
+
import { HomeIconButtonClickHandleEvent } from './event-plugins/HomeIconButtonClickHandleEvent';
|
|
3
4
|
import { UpdateLocationEvent } from './event-plugins/UpdateLocationEvent';
|
|
4
5
|
import { AppBridgeCallbackEvent } from './internal/AppBridgeCallbackEvent';
|
|
5
6
|
import { VisibilityChangedByTransparentServiceWebEvent } from './internal/VisibilityChangedByTransparentServiceWebEvent';
|
|
@@ -7,6 +8,7 @@ import { VisibilityChangedByTransparentServiceWebEvent } from './internal/Visibi
|
|
|
7
8
|
export const appsInTossEvent = new GraniteEvent([
|
|
8
9
|
new UpdateLocationEvent(),
|
|
9
10
|
new EntryMessageExitedEvent(),
|
|
11
|
+
new HomeIconButtonClickHandleEvent(),
|
|
10
12
|
// Internal events
|
|
11
13
|
new AppBridgeCallbackEvent(),
|
|
12
14
|
new VisibilityChangedByTransparentServiceWebEvent(),
|
package/src/AppsInTossModule/native-event-emitter/event-plugins/HomeIconButtonClickHandleEvent.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GraniteEventDefinition } from '@granite-js/react-native';
|
|
2
|
+
|
|
3
|
+
export class HomeIconButtonClickHandleEvent extends GraniteEventDefinition<undefined, undefined> {
|
|
4
|
+
name = 'homeIconButtonClickEvent' as const;
|
|
5
|
+
|
|
6
|
+
remove() {}
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9
|
+
listener(_: undefined) {}
|
|
10
|
+
}
|
|
@@ -3,3 +3,4 @@ export * from './contactsViral';
|
|
|
3
3
|
|
|
4
4
|
export { appsInTossEvent } from './appsInTossEvent';
|
|
5
5
|
export { onVisibilityChangedByTransparentServiceWeb } from './internal/onVisibilityChangedByTransparentServiceWeb';
|
|
6
|
+
export { INTERNAL__appBridgeHandler } from './internal/appBridge';
|