@apps-in-toss/framework 1.5.3 → 1.6.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/dist/index.cjs +436 -58
- package/dist/index.d.cts +68 -2
- package/dist/index.d.ts +68 -2
- package/dist/index.js +404 -24
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -165,11 +165,77 @@ declare function useTopNavigation(): {
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
declare const env: {
|
|
168
|
-
getDeploymentId: () => string
|
|
168
|
+
getDeploymentId: () => string;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
declare const INTERNAL__onVisibilityChangedByTransparentServiceWeb: typeof onVisibilityChangedByTransparentServiceWeb;
|
|
172
172
|
|
|
173
|
+
interface LoadFullScreenAdOptions {
|
|
174
|
+
adGroupId: string;
|
|
175
|
+
}
|
|
176
|
+
interface LoadFullScreenAdEvent {
|
|
177
|
+
type: 'loaded';
|
|
178
|
+
}
|
|
179
|
+
interface LoadFullScreenAdParams {
|
|
180
|
+
options: LoadFullScreenAdOptions;
|
|
181
|
+
onEvent: (data: LoadFullScreenAdEvent) => void;
|
|
182
|
+
onError: (err: unknown) => void;
|
|
183
|
+
}
|
|
184
|
+
declare const loadFullScreenAd: {
|
|
185
|
+
(params: LoadFullScreenAdParams): () => void;
|
|
186
|
+
isSupported: () => boolean;
|
|
187
|
+
};
|
|
188
|
+
interface ShowFullScreenAdOptions {
|
|
189
|
+
adGroupId: string;
|
|
190
|
+
}
|
|
191
|
+
type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
|
|
192
|
+
type AdClicked = {
|
|
193
|
+
type: 'clicked';
|
|
194
|
+
};
|
|
195
|
+
type AdDismissed = {
|
|
196
|
+
type: 'dismissed';
|
|
197
|
+
};
|
|
198
|
+
type AdFailedToShow = {
|
|
199
|
+
type: 'failedToShow';
|
|
200
|
+
};
|
|
201
|
+
type AdImpression = {
|
|
202
|
+
type: 'impression';
|
|
203
|
+
};
|
|
204
|
+
type AdShow = {
|
|
205
|
+
type: 'show';
|
|
206
|
+
};
|
|
207
|
+
type AdUserEarnedReward = {
|
|
208
|
+
type: 'userEarnedReward';
|
|
209
|
+
data: {
|
|
210
|
+
unitType: string;
|
|
211
|
+
unitAmount: number;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
type ShowFullScreenAdEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
|
|
215
|
+
type: 'requested';
|
|
216
|
+
};
|
|
217
|
+
interface ShowFullScreenAdParams {
|
|
218
|
+
options: ShowFullScreenAdOptions;
|
|
219
|
+
onEvent: (data: ShowFullScreenAdEvent) => void;
|
|
220
|
+
onError: (err: unknown) => void;
|
|
221
|
+
}
|
|
222
|
+
declare function showFullScreenAd(params: ShowFullScreenAdParams): () => void;
|
|
223
|
+
declare namespace showFullScreenAd {
|
|
224
|
+
var isSupported: () => boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
interface FetchTossAdOptions {
|
|
228
|
+
adGroupId: string;
|
|
229
|
+
sdkId: string;
|
|
230
|
+
availableStyleIds: string[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface TossAdEventLogParams {
|
|
234
|
+
log_name: string;
|
|
235
|
+
log_type: string;
|
|
236
|
+
params: Record<string, unknown>;
|
|
237
|
+
}
|
|
238
|
+
|
|
173
239
|
declare const Analytics: {
|
|
174
240
|
init: (options: _apps_in_toss_analytics.AnalyticsConfig) => void;
|
|
175
241
|
Impression: ({ enabled, impression: impressionType, ...props }: _apps_in_toss_analytics.LoggingImpressionProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -177,4 +243,4 @@ declare const Analytics: {
|
|
|
177
243
|
Area: ({ children, params: _params, ...props }: _apps_in_toss_analytics.LoggingAreaProps) => react_jsx_runtime.JSX.Element;
|
|
178
244
|
};
|
|
179
245
|
|
|
180
|
-
export { Analytics, AppsInToss, type ExternalWebViewProps, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, type PartnerWebViewProps, type UseGeolocationOptions, WebView, type WebViewProps, env, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
|
|
246
|
+
export { Analytics, AppsInToss, type ExternalWebViewProps, type FetchTossAdOptions, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, type LoadFullScreenAdEvent, type LoadFullScreenAdOptions, type LoadFullScreenAdParams, type PartnerWebViewProps, type ShowFullScreenAdEvent, type ShowFullScreenAdOptions, type ShowFullScreenAdParams, type TossAdEventLogParams, type UseGeolocationOptions, WebView, type WebViewProps, env, loadFullScreenAd, showFullScreenAd, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
|
package/dist/index.d.ts
CHANGED
|
@@ -165,11 +165,77 @@ declare function useTopNavigation(): {
|
|
|
165
165
|
};
|
|
166
166
|
|
|
167
167
|
declare const env: {
|
|
168
|
-
getDeploymentId: () => string
|
|
168
|
+
getDeploymentId: () => string;
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
declare const INTERNAL__onVisibilityChangedByTransparentServiceWeb: typeof onVisibilityChangedByTransparentServiceWeb;
|
|
172
172
|
|
|
173
|
+
interface LoadFullScreenAdOptions {
|
|
174
|
+
adGroupId: string;
|
|
175
|
+
}
|
|
176
|
+
interface LoadFullScreenAdEvent {
|
|
177
|
+
type: 'loaded';
|
|
178
|
+
}
|
|
179
|
+
interface LoadFullScreenAdParams {
|
|
180
|
+
options: LoadFullScreenAdOptions;
|
|
181
|
+
onEvent: (data: LoadFullScreenAdEvent) => void;
|
|
182
|
+
onError: (err: unknown) => void;
|
|
183
|
+
}
|
|
184
|
+
declare const loadFullScreenAd: {
|
|
185
|
+
(params: LoadFullScreenAdParams): () => void;
|
|
186
|
+
isSupported: () => boolean;
|
|
187
|
+
};
|
|
188
|
+
interface ShowFullScreenAdOptions {
|
|
189
|
+
adGroupId: string;
|
|
190
|
+
}
|
|
191
|
+
type AdMobFullScreenEvent = AdClicked | AdDismissed | AdFailedToShow | AdImpression | AdShow;
|
|
192
|
+
type AdClicked = {
|
|
193
|
+
type: 'clicked';
|
|
194
|
+
};
|
|
195
|
+
type AdDismissed = {
|
|
196
|
+
type: 'dismissed';
|
|
197
|
+
};
|
|
198
|
+
type AdFailedToShow = {
|
|
199
|
+
type: 'failedToShow';
|
|
200
|
+
};
|
|
201
|
+
type AdImpression = {
|
|
202
|
+
type: 'impression';
|
|
203
|
+
};
|
|
204
|
+
type AdShow = {
|
|
205
|
+
type: 'show';
|
|
206
|
+
};
|
|
207
|
+
type AdUserEarnedReward = {
|
|
208
|
+
type: 'userEarnedReward';
|
|
209
|
+
data: {
|
|
210
|
+
unitType: string;
|
|
211
|
+
unitAmount: number;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
type ShowFullScreenAdEvent = AdMobFullScreenEvent | AdUserEarnedReward | {
|
|
215
|
+
type: 'requested';
|
|
216
|
+
};
|
|
217
|
+
interface ShowFullScreenAdParams {
|
|
218
|
+
options: ShowFullScreenAdOptions;
|
|
219
|
+
onEvent: (data: ShowFullScreenAdEvent) => void;
|
|
220
|
+
onError: (err: unknown) => void;
|
|
221
|
+
}
|
|
222
|
+
declare function showFullScreenAd(params: ShowFullScreenAdParams): () => void;
|
|
223
|
+
declare namespace showFullScreenAd {
|
|
224
|
+
var isSupported: () => boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
interface FetchTossAdOptions {
|
|
228
|
+
adGroupId: string;
|
|
229
|
+
sdkId: string;
|
|
230
|
+
availableStyleIds: string[];
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
interface TossAdEventLogParams {
|
|
234
|
+
log_name: string;
|
|
235
|
+
log_type: string;
|
|
236
|
+
params: Record<string, unknown>;
|
|
237
|
+
}
|
|
238
|
+
|
|
173
239
|
declare const Analytics: {
|
|
174
240
|
init: (options: _apps_in_toss_analytics.AnalyticsConfig) => void;
|
|
175
241
|
Impression: ({ enabled, impression: impressionType, ...props }: _apps_in_toss_analytics.LoggingImpressionProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -177,4 +243,4 @@ declare const Analytics: {
|
|
|
177
243
|
Area: ({ children, params: _params, ...props }: _apps_in_toss_analytics.LoggingAreaProps) => react_jsx_runtime.JSX.Element;
|
|
178
244
|
};
|
|
179
245
|
|
|
180
|
-
export { Analytics, AppsInToss, type ExternalWebViewProps, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, type PartnerWebViewProps, type UseGeolocationOptions, WebView, type WebViewProps, env, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
|
|
246
|
+
export { Analytics, AppsInToss, type ExternalWebViewProps, type FetchTossAdOptions, type GameWebViewProps, INTERNAL__onVisibilityChangedByTransparentServiceWeb, type LoadFullScreenAdEvent, type LoadFullScreenAdOptions, type LoadFullScreenAdParams, type PartnerWebViewProps, type ShowFullScreenAdEvent, type ShowFullScreenAdOptions, type ShowFullScreenAdParams, type TossAdEventLogParams, type UseGeolocationOptions, WebView, type WebViewProps, env, loadFullScreenAd, showFullScreenAd, useCreateUserAgent, useGeolocation, useTopNavigation, useWaitForReturnNavigator };
|
package/dist/index.js
CHANGED
|
@@ -1391,7 +1391,7 @@ var AppsInToss = {
|
|
|
1391
1391
|
// src/components/WebView.tsx
|
|
1392
1392
|
import {
|
|
1393
1393
|
AppsInTossModule,
|
|
1394
|
-
GoogleAdMob,
|
|
1394
|
+
GoogleAdMob as GoogleAdMob2,
|
|
1395
1395
|
IAP,
|
|
1396
1396
|
Storage,
|
|
1397
1397
|
appsInTossEvent,
|
|
@@ -1403,7 +1403,7 @@ import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-brid
|
|
|
1403
1403
|
import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
|
|
1404
1404
|
import * as appsInTossEventBridges from "@apps-in-toss/native-modules/event-bridges";
|
|
1405
1405
|
import { useSafeAreaInsets as useSafeAreaInsets4 } from "@granite-js/native/react-native-safe-area-context";
|
|
1406
|
-
import { getSchemeUri as
|
|
1406
|
+
import { getSchemeUri as getSchemeUri8 } from "@granite-js/react-native";
|
|
1407
1407
|
import { ExternalWebViewScreen, tdsEvent } from "@toss/tds-react-native";
|
|
1408
1408
|
import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop3 } from "@toss/tds-react-native/private";
|
|
1409
1409
|
import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef6, useState as useState6 } from "react";
|
|
@@ -1579,6 +1579,364 @@ function convertIntentURL(url) {
|
|
|
1579
1579
|
return `${scheme}://${url.hostname}${url.pathname}${url.search}`;
|
|
1580
1580
|
}
|
|
1581
1581
|
|
|
1582
|
+
// src/ads/fetchTossAd.ts
|
|
1583
|
+
import {
|
|
1584
|
+
getOperationalEnvironment as getOperationalEnvironment5,
|
|
1585
|
+
INTERNAL__appBridgeHandler as INTERNAL__appBridgeHandler2,
|
|
1586
|
+
isMinVersionSupported as isMinVersionSupported4
|
|
1587
|
+
} from "@apps-in-toss/native-modules";
|
|
1588
|
+
|
|
1589
|
+
// ../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
1590
|
+
function noop() {
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
// src/ads/generateSessionId.ts
|
|
1594
|
+
function generateSessionId() {
|
|
1595
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
1596
|
+
const r = Math.random() * 16 | 0;
|
|
1597
|
+
const v = c === "x" ? r : r & 3 | 8;
|
|
1598
|
+
return v.toString(16);
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
// src/ads/constants.ts
|
|
1603
|
+
var sessionId = generateSessionId();
|
|
1604
|
+
|
|
1605
|
+
// src/ads/fetchTossAd.ts
|
|
1606
|
+
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1607
|
+
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1608
|
+
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1609
|
+
var ENVIRONMENT = getOperationalEnvironment5();
|
|
1610
|
+
function fetchTossAd(params) {
|
|
1611
|
+
if (!fetchTossAd.isSupported()) {
|
|
1612
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
1613
|
+
return noop;
|
|
1614
|
+
}
|
|
1615
|
+
const { onEvent, onError, options } = params;
|
|
1616
|
+
const { adGroupId } = options;
|
|
1617
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler2.invokeAppBridgeMethod(
|
|
1618
|
+
"fetchTossAd",
|
|
1619
|
+
{ spaceUnitId: adGroupId, sessionId, sdkId: options.sdkId, availableStyleIds: options.availableStyleIds },
|
|
1620
|
+
{
|
|
1621
|
+
onSuccess: (response) => {
|
|
1622
|
+
onEvent(response);
|
|
1623
|
+
},
|
|
1624
|
+
onError: (error) => {
|
|
1625
|
+
onError(error);
|
|
1626
|
+
}
|
|
1627
|
+
}
|
|
1628
|
+
);
|
|
1629
|
+
return unregisterCallbacks;
|
|
1630
|
+
}
|
|
1631
|
+
fetchTossAd.isSupported = () => {
|
|
1632
|
+
if (ENVIRONMENT !== "toss") {
|
|
1633
|
+
return false;
|
|
1634
|
+
}
|
|
1635
|
+
return isMinVersionSupported4({
|
|
1636
|
+
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1637
|
+
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1638
|
+
});
|
|
1639
|
+
};
|
|
1640
|
+
|
|
1641
|
+
// src/ads/integratedAd.ts
|
|
1642
|
+
import { GoogleAdMob, INTERNAL__appBridgeHandler as INTERNAL__appBridgeHandler3, isMinVersionSupported as isMinVersionSupported5 } from "@apps-in-toss/native-modules";
|
|
1643
|
+
|
|
1644
|
+
// src/ads/generateRequestId.ts
|
|
1645
|
+
function generateRequestId() {
|
|
1646
|
+
const timestamp = Date.now().toString(36).toUpperCase();
|
|
1647
|
+
const random = Math.random().toString(36).substring(2, 7).toUpperCase();
|
|
1648
|
+
return `ait-${timestamp}${random}`;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
// src/ads/getReferrer.ts
|
|
1652
|
+
import { getSchemeUri as getSchemeUri5 } from "@granite-js/react-native";
|
|
1653
|
+
function getReferrer() {
|
|
1654
|
+
try {
|
|
1655
|
+
return new URL(getSchemeUri5()).searchParams.get("referrer");
|
|
1656
|
+
} catch {
|
|
1657
|
+
return null;
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
// src/ads/remotes.ts
|
|
1662
|
+
import { getOperationalEnvironment as getOperationalEnvironment6, getPlatformOS, getTossAppVersion } from "@apps-in-toss/native-modules";
|
|
1663
|
+
|
|
1664
|
+
// src/ads/getIsDev.ts
|
|
1665
|
+
import { getSchemeUri as getSchemeUri6 } from "@granite-js/react-native";
|
|
1666
|
+
function getIsDev() {
|
|
1667
|
+
try {
|
|
1668
|
+
return new URL(getSchemeUri6()).searchParams.get("isDev") === "true";
|
|
1669
|
+
} catch {
|
|
1670
|
+
return false;
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
// src/ads/remotes.ts
|
|
1675
|
+
var OPERATIONAL_ENVIRONMENT = getOperationalEnvironment6();
|
|
1676
|
+
var OS = getPlatformOS();
|
|
1677
|
+
var APP_VER = getTossAppVersion();
|
|
1678
|
+
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1679
|
+
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1680
|
+
function getPostEventTrackingUrl() {
|
|
1681
|
+
const isDev = getIsDev();
|
|
1682
|
+
if (OPERATIONAL_ENVIRONMENT === "sandbox" || isDev) {
|
|
1683
|
+
return ALPHA_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1684
|
+
}
|
|
1685
|
+
return LIVE_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1686
|
+
}
|
|
1687
|
+
function postEventTracking(params) {
|
|
1688
|
+
const endpoint = getPostEventTrackingUrl();
|
|
1689
|
+
const bodyJSON = JSON.stringify({
|
|
1690
|
+
...params,
|
|
1691
|
+
os: OS,
|
|
1692
|
+
appVer: APP_VER,
|
|
1693
|
+
deviceIdType: "NONE",
|
|
1694
|
+
platform: "RN"
|
|
1695
|
+
});
|
|
1696
|
+
return fetch(
|
|
1697
|
+
endpoint,
|
|
1698
|
+
{
|
|
1699
|
+
method: "POST",
|
|
1700
|
+
headers: {
|
|
1701
|
+
"Content-Type": "application/json"
|
|
1702
|
+
},
|
|
1703
|
+
body: bodyJSON
|
|
1704
|
+
}
|
|
1705
|
+
).catch(noop);
|
|
1706
|
+
}
|
|
1707
|
+
|
|
1708
|
+
// src/ads/integratedAd.ts
|
|
1709
|
+
var INTEGRATED_AD_SDK_VERSION = "0.0.0";
|
|
1710
|
+
var ANDROID_INTEGRATED_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1711
|
+
var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1712
|
+
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1713
|
+
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1714
|
+
function integratedAdIsSupported() {
|
|
1715
|
+
return isMinVersionSupported5({
|
|
1716
|
+
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1717
|
+
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1718
|
+
});
|
|
1719
|
+
}
|
|
1720
|
+
function generateLoadFullScreenAd(sdkId) {
|
|
1721
|
+
const fn = (params) => {
|
|
1722
|
+
if (!GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1723
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1724
|
+
return noop;
|
|
1725
|
+
}
|
|
1726
|
+
if (!integratedAdIsSupported()) {
|
|
1727
|
+
return GoogleAdMob.loadAppsInTossAdMob({
|
|
1728
|
+
...params,
|
|
1729
|
+
onEvent: (event) => {
|
|
1730
|
+
if (event.type === "loaded") {
|
|
1731
|
+
const requestId = generateRequestId();
|
|
1732
|
+
INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] = requestId;
|
|
1733
|
+
postEventTracking({
|
|
1734
|
+
eventName: "LOAD",
|
|
1735
|
+
spaceUnitId: params.options.adGroupId,
|
|
1736
|
+
requestId,
|
|
1737
|
+
responseId: event.data.responseInfo.responseId,
|
|
1738
|
+
mediationType: "ADMOB",
|
|
1739
|
+
format: "",
|
|
1740
|
+
adSourceName: event.data.responseInfo.loadedAdNetworkInfo?.adSourceName ?? "",
|
|
1741
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
return params.onEvent(event);
|
|
1745
|
+
},
|
|
1746
|
+
onError: (error) => {
|
|
1747
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1748
|
+
postEventTracking({
|
|
1749
|
+
eventName: "FAILED_TO_LOAD",
|
|
1750
|
+
spaceUnitId: params.options.adGroupId,
|
|
1751
|
+
requestId,
|
|
1752
|
+
responseId: "",
|
|
1753
|
+
mediationType: "ADMOB",
|
|
1754
|
+
format: "",
|
|
1755
|
+
adSourceName: "",
|
|
1756
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1757
|
+
});
|
|
1758
|
+
return params.onError(error);
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
}
|
|
1762
|
+
const { onEvent, onError, options } = params;
|
|
1763
|
+
const { adGroupId } = options;
|
|
1764
|
+
const referrer = getReferrer();
|
|
1765
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler3.invokeAppBridgeMethod(
|
|
1766
|
+
"loadTossAdOrAdmob",
|
|
1767
|
+
{ spaceUnitId: adGroupId, referrer, sessionId, sdkId },
|
|
1768
|
+
{
|
|
1769
|
+
onSuccess: () => {
|
|
1770
|
+
onEvent({ type: "loaded" });
|
|
1771
|
+
},
|
|
1772
|
+
onError: (error) => {
|
|
1773
|
+
onError(error);
|
|
1774
|
+
}
|
|
1775
|
+
}
|
|
1776
|
+
);
|
|
1777
|
+
return unregisterCallbacks;
|
|
1778
|
+
};
|
|
1779
|
+
fn.isSupported = GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1780
|
+
return fn;
|
|
1781
|
+
}
|
|
1782
|
+
var loadFullScreenAd = generateLoadFullScreenAd("107");
|
|
1783
|
+
var loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
|
|
1784
|
+
function showFullScreenAd(params) {
|
|
1785
|
+
if (!GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1786
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1787
|
+
return noop;
|
|
1788
|
+
}
|
|
1789
|
+
if (!integratedAdIsSupported()) {
|
|
1790
|
+
return GoogleAdMob.showAppsInTossAdMob({
|
|
1791
|
+
...params,
|
|
1792
|
+
onEvent: (event) => {
|
|
1793
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1794
|
+
switch (event.type) {
|
|
1795
|
+
case "show":
|
|
1796
|
+
postEventTracking({
|
|
1797
|
+
eventName: "SHOW",
|
|
1798
|
+
spaceUnitId: params.options.adGroupId,
|
|
1799
|
+
requestId,
|
|
1800
|
+
responseId: "",
|
|
1801
|
+
mediationType: "ADMOB",
|
|
1802
|
+
format: "",
|
|
1803
|
+
adSourceName: "",
|
|
1804
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1805
|
+
});
|
|
1806
|
+
break;
|
|
1807
|
+
case "failedToShow":
|
|
1808
|
+
postEventTracking({
|
|
1809
|
+
eventName: "FAILED_TO_SHOW",
|
|
1810
|
+
spaceUnitId: params.options.adGroupId,
|
|
1811
|
+
requestId,
|
|
1812
|
+
responseId: "",
|
|
1813
|
+
mediationType: "ADMOB",
|
|
1814
|
+
format: "",
|
|
1815
|
+
adSourceName: "",
|
|
1816
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1817
|
+
});
|
|
1818
|
+
break;
|
|
1819
|
+
case "impression":
|
|
1820
|
+
postEventTracking({
|
|
1821
|
+
eventName: "IMP",
|
|
1822
|
+
spaceUnitId: params.options.adGroupId,
|
|
1823
|
+
requestId,
|
|
1824
|
+
responseId: "",
|
|
1825
|
+
mediationType: "ADMOB",
|
|
1826
|
+
format: "",
|
|
1827
|
+
adSourceName: "",
|
|
1828
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1829
|
+
});
|
|
1830
|
+
break;
|
|
1831
|
+
case "clicked":
|
|
1832
|
+
postEventTracking({
|
|
1833
|
+
eventName: "CLICK",
|
|
1834
|
+
spaceUnitId: params.options.adGroupId,
|
|
1835
|
+
requestId,
|
|
1836
|
+
responseId: "",
|
|
1837
|
+
mediationType: "ADMOB",
|
|
1838
|
+
format: "",
|
|
1839
|
+
adSourceName: "",
|
|
1840
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1841
|
+
});
|
|
1842
|
+
break;
|
|
1843
|
+
case "dismissed":
|
|
1844
|
+
postEventTracking({
|
|
1845
|
+
eventName: "DISMISS",
|
|
1846
|
+
spaceUnitId: params.options.adGroupId,
|
|
1847
|
+
requestId,
|
|
1848
|
+
responseId: "",
|
|
1849
|
+
mediationType: "ADMOB",
|
|
1850
|
+
format: "",
|
|
1851
|
+
adSourceName: "",
|
|
1852
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1853
|
+
});
|
|
1854
|
+
break;
|
|
1855
|
+
case "userEarnedReward":
|
|
1856
|
+
postEventTracking({
|
|
1857
|
+
eventName: "USER_EARNED_REWARD",
|
|
1858
|
+
spaceUnitId: params.options.adGroupId,
|
|
1859
|
+
requestId,
|
|
1860
|
+
responseId: "",
|
|
1861
|
+
mediationType: "ADMOB",
|
|
1862
|
+
format: "",
|
|
1863
|
+
adSourceName: "",
|
|
1864
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1865
|
+
});
|
|
1866
|
+
break;
|
|
1867
|
+
}
|
|
1868
|
+
return params.onEvent(event);
|
|
1869
|
+
},
|
|
1870
|
+
onError: (error) => {
|
|
1871
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1872
|
+
postEventTracking({
|
|
1873
|
+
eventName: "FAILED_TO_SHOW",
|
|
1874
|
+
spaceUnitId: params.options.adGroupId,
|
|
1875
|
+
requestId,
|
|
1876
|
+
responseId: "",
|
|
1877
|
+
mediationType: "ADMOB",
|
|
1878
|
+
format: "",
|
|
1879
|
+
adSourceName: "",
|
|
1880
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1881
|
+
});
|
|
1882
|
+
return params.onError(error);
|
|
1883
|
+
}
|
|
1884
|
+
});
|
|
1885
|
+
}
|
|
1886
|
+
const { onEvent, onError, options } = params;
|
|
1887
|
+
const { adGroupId } = options;
|
|
1888
|
+
const referrer = getReferrer();
|
|
1889
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler3.invokeAppBridgeMethod(
|
|
1890
|
+
"showTossAdOrAdmob",
|
|
1891
|
+
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1892
|
+
{
|
|
1893
|
+
onAdClicked: () => {
|
|
1894
|
+
onEvent({ type: "clicked" });
|
|
1895
|
+
},
|
|
1896
|
+
onAdDismissed: () => {
|
|
1897
|
+
onEvent({ type: "dismissed" });
|
|
1898
|
+
},
|
|
1899
|
+
onAdFailedToShow: () => {
|
|
1900
|
+
onEvent({ type: "failedToShow" });
|
|
1901
|
+
},
|
|
1902
|
+
onAdImpression: () => {
|
|
1903
|
+
onEvent({ type: "impression" });
|
|
1904
|
+
},
|
|
1905
|
+
onAdShow: () => {
|
|
1906
|
+
onEvent({ type: "show" });
|
|
1907
|
+
},
|
|
1908
|
+
onUserEarnedReward: (data) => {
|
|
1909
|
+
onEvent({ type: "userEarnedReward", data });
|
|
1910
|
+
},
|
|
1911
|
+
onSuccess: () => {
|
|
1912
|
+
onEvent({ type: "requested" });
|
|
1913
|
+
},
|
|
1914
|
+
onError: (error) => {
|
|
1915
|
+
onError(error);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
);
|
|
1919
|
+
return unregisterCallbacks;
|
|
1920
|
+
}
|
|
1921
|
+
showFullScreenAd.isSupported = GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
1922
|
+
|
|
1923
|
+
// src/ads/tossAdEventLog.ts
|
|
1924
|
+
import { INTERNAL__module as INTERNAL__module6 } from "@apps-in-toss/native-modules";
|
|
1925
|
+
import { Granite as Granite8 } from "@granite-js/react-native";
|
|
1926
|
+
async function tossAdEventLog(params) {
|
|
1927
|
+
const referrer = getReferrer();
|
|
1928
|
+
const appName = Granite8.appName;
|
|
1929
|
+
const eventLogParams = {
|
|
1930
|
+
...params,
|
|
1931
|
+
params: {
|
|
1932
|
+
...params.params,
|
|
1933
|
+
referrer,
|
|
1934
|
+
app_name: appName
|
|
1935
|
+
}
|
|
1936
|
+
};
|
|
1937
|
+
return INTERNAL__module6.tossCoreEventLog(eventLogParams);
|
|
1938
|
+
}
|
|
1939
|
+
|
|
1582
1940
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1583
1941
|
import { useCallback as useCallback10, useEffect as useEffect10, useMemo as useMemo3, useRef as useRef4 } from "react";
|
|
1584
1942
|
function serializeError(error) {
|
|
@@ -1903,7 +2261,7 @@ function mergeRefs(...refs) {
|
|
|
1903
2261
|
}
|
|
1904
2262
|
|
|
1905
2263
|
// src/hooks/useCreateUserAgent.ts
|
|
1906
|
-
import { getPlatformOS, getTossAppVersion } from "@apps-in-toss/native-modules";
|
|
2264
|
+
import { getPlatformOS as getPlatformOS2, getTossAppVersion as getTossAppVersion2 } from "@apps-in-toss/native-modules";
|
|
1907
2265
|
import { useWindowDimensions } from "react-native";
|
|
1908
2266
|
var FontA11yCategory = {
|
|
1909
2267
|
Large: "Large",
|
|
@@ -2037,8 +2395,8 @@ function useCreateUserAgent({
|
|
|
2037
2395
|
safeArea,
|
|
2038
2396
|
safeAreaBottomTransparency
|
|
2039
2397
|
}) {
|
|
2040
|
-
const platform =
|
|
2041
|
-
const appVersion =
|
|
2398
|
+
const platform = getPlatformOS2();
|
|
2399
|
+
const appVersion = getTossAppVersion2();
|
|
2042
2400
|
const { fontScale } = useWindowDimensions();
|
|
2043
2401
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2044
2402
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
@@ -2124,7 +2482,7 @@ function useTopNavigation() {
|
|
|
2124
2482
|
|
|
2125
2483
|
// src/utils/log.ts
|
|
2126
2484
|
import { eventLog as eventLogNative } from "@apps-in-toss/native-modules";
|
|
2127
|
-
import { getSchemeUri as
|
|
2485
|
+
import { getSchemeUri as getSchemeUri7 } from "@granite-js/react-native";
|
|
2128
2486
|
|
|
2129
2487
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2130
2488
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2148,9 +2506,9 @@ var getGroupId = (url) => {
|
|
|
2148
2506
|
};
|
|
2149
2507
|
}
|
|
2150
2508
|
};
|
|
2151
|
-
var
|
|
2509
|
+
var getReferrer2 = () => {
|
|
2152
2510
|
try {
|
|
2153
|
-
const referrer = new URL(
|
|
2511
|
+
const referrer = new URL(getSchemeUri7());
|
|
2154
2512
|
return referrer.searchParams.get("referrer");
|
|
2155
2513
|
} catch {
|
|
2156
2514
|
return "";
|
|
@@ -2163,7 +2521,7 @@ var trackScreen = (url) => {
|
|
|
2163
2521
|
log_name: `${groupId}::screen`,
|
|
2164
2522
|
params: {
|
|
2165
2523
|
search,
|
|
2166
|
-
referrer:
|
|
2524
|
+
referrer: getReferrer2(),
|
|
2167
2525
|
deployment_id: env.getDeploymentId(),
|
|
2168
2526
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2169
2527
|
}
|
|
@@ -2182,7 +2540,7 @@ var WEBVIEW_TYPES = {
|
|
|
2182
2540
|
};
|
|
2183
2541
|
function mergeSchemeQueryParamsInto(url) {
|
|
2184
2542
|
const baseUrl = new URL(url);
|
|
2185
|
-
const schemeUrl = new URL(
|
|
2543
|
+
const schemeUrl = new URL(getSchemeUri8());
|
|
2186
2544
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2187
2545
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2188
2546
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2239,13 +2597,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2239
2597
|
/** @internal */
|
|
2240
2598
|
appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2241
2599
|
/** AdMob */
|
|
2242
|
-
loadAdMobInterstitialAd:
|
|
2243
|
-
showAdMobInterstitialAd:
|
|
2244
|
-
loadAdMobRewardedAd:
|
|
2245
|
-
showAdMobRewardedAd:
|
|
2600
|
+
loadAdMobInterstitialAd: GoogleAdMob2.loadAdMobInterstitialAd,
|
|
2601
|
+
showAdMobInterstitialAd: GoogleAdMob2.showAdMobInterstitialAd,
|
|
2602
|
+
loadAdMobRewardedAd: GoogleAdMob2.loadAdMobRewardedAd,
|
|
2603
|
+
showAdMobRewardedAd: GoogleAdMob2.showAdMobRewardedAd,
|
|
2246
2604
|
/** AdMobV2 */
|
|
2247
|
-
loadAppsInTossAdMob:
|
|
2248
|
-
showAppsInTossAdMob:
|
|
2605
|
+
loadAppsInTossAdMob: GoogleAdMob2.loadAppsInTossAdMob,
|
|
2606
|
+
showAppsInTossAdMob: GoogleAdMob2.showAppsInTossAdMob,
|
|
2607
|
+
/** IntegratedAd */
|
|
2608
|
+
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
2609
|
+
showFullScreenAd,
|
|
2610
|
+
/** TossAd */
|
|
2611
|
+
fetchTossAd,
|
|
2249
2612
|
/** IAP */
|
|
2250
2613
|
iapCreateOneTimePurchaseOrder: IAP.createOneTimePurchaseOrder,
|
|
2251
2614
|
requestOneTimePurchase
|
|
@@ -2258,13 +2621,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2258
2621
|
getSafeAreaRight: () => insets.right,
|
|
2259
2622
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2260
2623
|
/** AdMob */
|
|
2261
|
-
loadAdMobInterstitialAd_isSupported:
|
|
2262
|
-
showAdMobInterstitialAd_isSupported:
|
|
2263
|
-
loadAdMobRewardedAd_isSupported:
|
|
2264
|
-
showAdMobRewardedAd_isSupported:
|
|
2624
|
+
loadAdMobInterstitialAd_isSupported: GoogleAdMob2.loadAdMobInterstitialAd.isSupported,
|
|
2625
|
+
showAdMobInterstitialAd_isSupported: GoogleAdMob2.showAdMobInterstitialAd.isSupported,
|
|
2626
|
+
loadAdMobRewardedAd_isSupported: GoogleAdMob2.loadAdMobRewardedAd.isSupported,
|
|
2627
|
+
showAdMobRewardedAd_isSupported: GoogleAdMob2.showAdMobRewardedAd.isSupported,
|
|
2265
2628
|
/** AdMobV2 */
|
|
2266
|
-
loadAppsInTossAdMob_isSupported:
|
|
2267
|
-
showAppsInTossAdMob_isSupported:
|
|
2629
|
+
loadAppsInTossAdMob_isSupported: GoogleAdMob2.loadAppsInTossAdMob.isSupported,
|
|
2630
|
+
showAppsInTossAdMob_isSupported: GoogleAdMob2.showAppsInTossAdMob.isSupported,
|
|
2631
|
+
/** IntegratedAd */
|
|
2632
|
+
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
2633
|
+
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
2634
|
+
/** TossAd */
|
|
2635
|
+
fetchTossAd_isSupported: fetchTossAd.isSupported,
|
|
2268
2636
|
/** env */
|
|
2269
2637
|
getDeploymentId: env.getDeploymentId
|
|
2270
2638
|
},
|
|
@@ -2297,7 +2665,9 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2297
2665
|
processProductGrant,
|
|
2298
2666
|
getPendingOrders: IAP.getPendingOrders,
|
|
2299
2667
|
getCompletedOrRefundedOrders: IAP.getCompletedOrRefundedOrders,
|
|
2300
|
-
completeProductGrant: IAP.completeProductGrant
|
|
2668
|
+
completeProductGrant: IAP.completeProductGrant,
|
|
2669
|
+
/** Toss Ads */
|
|
2670
|
+
tossAdEventLog
|
|
2301
2671
|
}
|
|
2302
2672
|
});
|
|
2303
2673
|
const headerPropForExternalWebView = useMemo7(() => {
|
|
@@ -2375,7 +2745,15 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2375
2745
|
return false;
|
|
2376
2746
|
}
|
|
2377
2747
|
},
|
|
2378
|
-
originWhitelist: [
|
|
2748
|
+
originWhitelist: [
|
|
2749
|
+
"https://*",
|
|
2750
|
+
"http://*",
|
|
2751
|
+
"intoss://*",
|
|
2752
|
+
"intoss-private://*",
|
|
2753
|
+
"servicetoss://*",
|
|
2754
|
+
"supertoss://*",
|
|
2755
|
+
"intent://*"
|
|
2756
|
+
]
|
|
2379
2757
|
}
|
|
2380
2758
|
);
|
|
2381
2759
|
}
|
|
@@ -2459,6 +2837,8 @@ export {
|
|
|
2459
2837
|
OverlayProvider,
|
|
2460
2838
|
WebView,
|
|
2461
2839
|
env,
|
|
2840
|
+
loadFullScreenAd,
|
|
2841
|
+
showFullScreenAd,
|
|
2462
2842
|
useCreateUserAgent,
|
|
2463
2843
|
useGeolocation,
|
|
2464
2844
|
useOverlay3 as useOverlay,
|