@apps-in-toss/framework 1.5.3 → 1.6.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.
- package/CHANGELOG.md +10 -0
- package/bin/ait.js +0 -0
- package/dist/index.cjs +503 -104
- package/dist/index.d.cts +68 -2
- package/dist/index.d.ts +68 -2
- package/dist/index.js +468 -67
- package/package.json +10 -15
package/dist/index.js
CHANGED
|
@@ -691,15 +691,18 @@ import { useCallback as useCallback7 } from "react";
|
|
|
691
691
|
function useCloseConfirm() {
|
|
692
692
|
const { brandDisplayName } = getAppsInTossGlobals();
|
|
693
693
|
const { openConfirm } = useDialog3();
|
|
694
|
-
return useCallback7(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
694
|
+
return useCallback7(
|
|
695
|
+
async ({ onEntered }) => {
|
|
696
|
+
return await openConfirm({
|
|
697
|
+
title: `${josa2(brandDisplayName, "\uC744/\uB97C")} \uC885\uB8CC\uD560\uAE4C\uC694?`,
|
|
698
|
+
leftButton: "\uCDE8\uC18C",
|
|
699
|
+
rightButton: "\uC885\uB8CC\uD558\uAE30",
|
|
700
|
+
closeOnDimmerClick: true,
|
|
701
|
+
onEntered
|
|
702
|
+
});
|
|
703
|
+
},
|
|
704
|
+
[brandDisplayName, openConfirm]
|
|
705
|
+
);
|
|
703
706
|
}
|
|
704
707
|
|
|
705
708
|
// src/components/NavigationBar/common/useNavigationBarLogging.tsx
|
|
@@ -938,30 +941,10 @@ function Menu({ title, iconURL, onPress }) {
|
|
|
938
941
|
marginRight: 16,
|
|
939
942
|
backgroundColor: iconBackgroundColor
|
|
940
943
|
},
|
|
941
|
-
children: iconName ? /* @__PURE__ */ jsx5(
|
|
942
|
-
Asset2.Icon,
|
|
943
|
-
{
|
|
944
|
-
frameShape: { width: 20, height: 20 },
|
|
945
|
-
color: globals.brandPrimaryColor,
|
|
946
|
-
name: iconName
|
|
947
|
-
}
|
|
948
|
-
) : /* @__PURE__ */ jsx5(
|
|
949
|
-
Asset2.Image,
|
|
950
|
-
{
|
|
951
|
-
frameShape: { width: 20, height: 20 },
|
|
952
|
-
source: { uri: iconURL }
|
|
953
|
-
}
|
|
954
|
-
)
|
|
955
|
-
}
|
|
956
|
-
),
|
|
957
|
-
contents: /* @__PURE__ */ jsx5(
|
|
958
|
-
ListRow.Texts,
|
|
959
|
-
{
|
|
960
|
-
type: "1RowTypeA",
|
|
961
|
-
top: title,
|
|
962
|
-
topProps: { color: adaptive.grey700 }
|
|
944
|
+
children: iconName ? /* @__PURE__ */ jsx5(Asset2.Icon, { frameShape: { width: 20, height: 20 }, color: globals.brandPrimaryColor, name: iconName }) : /* @__PURE__ */ jsx5(Asset2.Image, { frameShape: { width: 20, height: 20 }, source: { uri: iconURL } })
|
|
963
945
|
}
|
|
964
946
|
),
|
|
947
|
+
contents: /* @__PURE__ */ jsx5(ListRow.Texts, { type: "1RowTypeA", top: title, topProps: { color: adaptive.grey700 } }),
|
|
965
948
|
verticalPadding: "extraSmall",
|
|
966
949
|
onPress: () => {
|
|
967
950
|
logging.menuClick({ title });
|
|
@@ -1051,7 +1034,9 @@ function PermissionsMenu() {
|
|
|
1051
1034
|
{
|
|
1052
1035
|
title: "\uAD8C\uD55C \uC124\uC815",
|
|
1053
1036
|
iconURL: "https://static.toss.im/icons/png/4x/icon-setting-mono.png",
|
|
1054
|
-
onPress: () => openURL4(
|
|
1037
|
+
onPress: () => openURL4(
|
|
1038
|
+
`servicetoss://apps-in-toss-menu/permissions?appName=${Granite6.appName}&displayAppName=${globals.brandDisplayName}`
|
|
1039
|
+
)
|
|
1055
1040
|
}
|
|
1056
1041
|
);
|
|
1057
1042
|
}
|
|
@@ -1154,17 +1139,15 @@ function useMoreButtonBottomSheet() {
|
|
|
1154
1139
|
onClose: handleClose,
|
|
1155
1140
|
onExited: exit,
|
|
1156
1141
|
children: /* @__PURE__ */ jsxs2(List, { rowSeparator: "none", children: [
|
|
1157
|
-
itemList.map(
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
)
|
|
1167
|
-
),
|
|
1142
|
+
itemList.map((item) => /* @__PURE__ */ jsx8(
|
|
1143
|
+
Menu,
|
|
1144
|
+
{
|
|
1145
|
+
title: item.contactItemName,
|
|
1146
|
+
iconURL: item.contactIconUrl,
|
|
1147
|
+
onPress: () => openURL5(item.contactUri)
|
|
1148
|
+
},
|
|
1149
|
+
item.contactItemName
|
|
1150
|
+
)),
|
|
1168
1151
|
isShareListMenuSupported && /* @__PURE__ */ jsx8(AppShareListMenu, {}),
|
|
1169
1152
|
isPermissionsMenuSupported && /* @__PURE__ */ jsx8(PermissionsMenu, {})
|
|
1170
1153
|
] })
|
|
@@ -1391,7 +1374,7 @@ var AppsInToss = {
|
|
|
1391
1374
|
// src/components/WebView.tsx
|
|
1392
1375
|
import {
|
|
1393
1376
|
AppsInTossModule,
|
|
1394
|
-
GoogleAdMob,
|
|
1377
|
+
GoogleAdMob as GoogleAdMob2,
|
|
1395
1378
|
IAP,
|
|
1396
1379
|
Storage,
|
|
1397
1380
|
appsInTossEvent,
|
|
@@ -1403,7 +1386,7 @@ import * as appsInTossAsyncBridges from "@apps-in-toss/native-modules/async-brid
|
|
|
1403
1386
|
import * as appsInTossConstantBridges from "@apps-in-toss/native-modules/constant-bridges";
|
|
1404
1387
|
import * as appsInTossEventBridges from "@apps-in-toss/native-modules/event-bridges";
|
|
1405
1388
|
import { useSafeAreaInsets as useSafeAreaInsets4 } from "@granite-js/native/react-native-safe-area-context";
|
|
1406
|
-
import { getSchemeUri as
|
|
1389
|
+
import { getSchemeUri as getSchemeUri8 } from "@granite-js/react-native";
|
|
1407
1390
|
import { ExternalWebViewScreen, tdsEvent } from "@toss/tds-react-native";
|
|
1408
1391
|
import { useSafeAreaBottom, useSafeAreaTop as useSafeAreaTop3 } from "@toss/tds-react-native/private";
|
|
1409
1392
|
import { useEffect as useEffect13, useMemo as useMemo7, useRef as useRef6, useState as useState6 } from "react";
|
|
@@ -1579,6 +1562,361 @@ function convertIntentURL(url) {
|
|
|
1579
1562
|
return `${scheme}://${url.hostname}${url.pathname}${url.search}`;
|
|
1580
1563
|
}
|
|
1581
1564
|
|
|
1565
|
+
// src/ads/fetchTossAd.ts
|
|
1566
|
+
import {
|
|
1567
|
+
getOperationalEnvironment as getOperationalEnvironment5,
|
|
1568
|
+
INTERNAL__appBridgeHandler as INTERNAL__appBridgeHandler2,
|
|
1569
|
+
isMinVersionSupported as isMinVersionSupported4
|
|
1570
|
+
} from "@apps-in-toss/native-modules";
|
|
1571
|
+
|
|
1572
|
+
// ../../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
1573
|
+
function noop() {
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
// src/ads/generateSessionId.ts
|
|
1577
|
+
function generateSessionId() {
|
|
1578
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
1579
|
+
const r = Math.random() * 16 | 0;
|
|
1580
|
+
const v = c === "x" ? r : r & 3 | 8;
|
|
1581
|
+
return v.toString(16);
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
// src/ads/constants.ts
|
|
1586
|
+
var sessionId = generateSessionId();
|
|
1587
|
+
|
|
1588
|
+
// src/ads/fetchTossAd.ts
|
|
1589
|
+
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1590
|
+
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1591
|
+
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1592
|
+
var ENVIRONMENT = getOperationalEnvironment5();
|
|
1593
|
+
function fetchTossAd(params) {
|
|
1594
|
+
if (!fetchTossAd.isSupported()) {
|
|
1595
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
1596
|
+
return noop;
|
|
1597
|
+
}
|
|
1598
|
+
const { onEvent, onError, options } = params;
|
|
1599
|
+
const { adGroupId } = options;
|
|
1600
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler2.invokeAppBridgeMethod(
|
|
1601
|
+
"fetchTossAd",
|
|
1602
|
+
{ spaceUnitId: adGroupId, sessionId, sdkId: options.sdkId, availableStyleIds: options.availableStyleIds },
|
|
1603
|
+
{
|
|
1604
|
+
onSuccess: (response) => {
|
|
1605
|
+
onEvent(response);
|
|
1606
|
+
},
|
|
1607
|
+
onError: (error) => {
|
|
1608
|
+
onError(error);
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
);
|
|
1612
|
+
return unregisterCallbacks;
|
|
1613
|
+
}
|
|
1614
|
+
fetchTossAd.isSupported = () => {
|
|
1615
|
+
if (ENVIRONMENT !== "toss") {
|
|
1616
|
+
return false;
|
|
1617
|
+
}
|
|
1618
|
+
return isMinVersionSupported4({
|
|
1619
|
+
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1620
|
+
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1621
|
+
});
|
|
1622
|
+
};
|
|
1623
|
+
|
|
1624
|
+
// src/ads/integratedAd.ts
|
|
1625
|
+
import { GoogleAdMob, INTERNAL__appBridgeHandler as INTERNAL__appBridgeHandler3, isMinVersionSupported as isMinVersionSupported5 } from "@apps-in-toss/native-modules";
|
|
1626
|
+
|
|
1627
|
+
// src/ads/generateRequestId.ts
|
|
1628
|
+
function generateRequestId() {
|
|
1629
|
+
const timestamp = Date.now().toString(36).toUpperCase();
|
|
1630
|
+
const random = Math.random().toString(36).substring(2, 7).toUpperCase();
|
|
1631
|
+
return `ait-${timestamp}${random}`;
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
// src/ads/getReferrer.ts
|
|
1635
|
+
import { getSchemeUri as getSchemeUri5 } from "@granite-js/react-native";
|
|
1636
|
+
function getReferrer() {
|
|
1637
|
+
try {
|
|
1638
|
+
return new URL(getSchemeUri5()).searchParams.get("referrer");
|
|
1639
|
+
} catch {
|
|
1640
|
+
return null;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
// src/ads/remotes.ts
|
|
1645
|
+
import { getOperationalEnvironment as getOperationalEnvironment6, getPlatformOS, getTossAppVersion } from "@apps-in-toss/native-modules";
|
|
1646
|
+
|
|
1647
|
+
// src/ads/getIsDev.ts
|
|
1648
|
+
import { getSchemeUri as getSchemeUri6 } from "@granite-js/react-native";
|
|
1649
|
+
function getIsDev() {
|
|
1650
|
+
try {
|
|
1651
|
+
return new URL(getSchemeUri6()).searchParams.get("isDev") === "true";
|
|
1652
|
+
} catch {
|
|
1653
|
+
return false;
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
|
|
1657
|
+
// src/ads/remotes.ts
|
|
1658
|
+
var OPERATIONAL_ENVIRONMENT = getOperationalEnvironment6();
|
|
1659
|
+
var OS = getPlatformOS();
|
|
1660
|
+
var APP_VER = getTossAppVersion();
|
|
1661
|
+
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1662
|
+
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1663
|
+
function getPostEventTrackingUrl() {
|
|
1664
|
+
const isDev = getIsDev();
|
|
1665
|
+
if (OPERATIONAL_ENVIRONMENT === "sandbox" || isDev) {
|
|
1666
|
+
return ALPHA_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1667
|
+
}
|
|
1668
|
+
return LIVE_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1669
|
+
}
|
|
1670
|
+
function postEventTracking(params) {
|
|
1671
|
+
const endpoint = getPostEventTrackingUrl();
|
|
1672
|
+
const bodyJSON = JSON.stringify({
|
|
1673
|
+
...params,
|
|
1674
|
+
os: OS,
|
|
1675
|
+
appVer: APP_VER,
|
|
1676
|
+
deviceIdType: "NONE",
|
|
1677
|
+
platform: "RN"
|
|
1678
|
+
});
|
|
1679
|
+
return fetch(endpoint, {
|
|
1680
|
+
method: "POST",
|
|
1681
|
+
headers: {
|
|
1682
|
+
"Content-Type": "application/json"
|
|
1683
|
+
},
|
|
1684
|
+
body: bodyJSON
|
|
1685
|
+
}).catch(noop);
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
// src/ads/integratedAd.ts
|
|
1689
|
+
var INTEGRATED_AD_SDK_VERSION = "0.0.0";
|
|
1690
|
+
var ANDROID_INTEGRATED_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1691
|
+
var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1692
|
+
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1693
|
+
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1694
|
+
function integratedAdIsSupported() {
|
|
1695
|
+
return isMinVersionSupported5({
|
|
1696
|
+
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1697
|
+
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
function generateLoadFullScreenAd(sdkId) {
|
|
1701
|
+
const fn = (params) => {
|
|
1702
|
+
if (!GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1703
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1704
|
+
return noop;
|
|
1705
|
+
}
|
|
1706
|
+
if (!integratedAdIsSupported()) {
|
|
1707
|
+
return GoogleAdMob.loadAppsInTossAdMob({
|
|
1708
|
+
...params,
|
|
1709
|
+
onEvent: (event) => {
|
|
1710
|
+
if (event.type === "loaded") {
|
|
1711
|
+
const requestId = generateRequestId();
|
|
1712
|
+
INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] = requestId;
|
|
1713
|
+
postEventTracking({
|
|
1714
|
+
eventName: "LOAD",
|
|
1715
|
+
spaceUnitId: params.options.adGroupId,
|
|
1716
|
+
requestId,
|
|
1717
|
+
responseId: event.data.responseInfo.responseId,
|
|
1718
|
+
mediationType: "ADMOB",
|
|
1719
|
+
format: "",
|
|
1720
|
+
adSourceName: event.data.responseInfo.loadedAdNetworkInfo?.adSourceName ?? "",
|
|
1721
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1722
|
+
});
|
|
1723
|
+
}
|
|
1724
|
+
return params.onEvent(event);
|
|
1725
|
+
},
|
|
1726
|
+
onError: (error) => {
|
|
1727
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1728
|
+
postEventTracking({
|
|
1729
|
+
eventName: "FAILED_TO_LOAD",
|
|
1730
|
+
spaceUnitId: params.options.adGroupId,
|
|
1731
|
+
requestId,
|
|
1732
|
+
responseId: "",
|
|
1733
|
+
mediationType: "ADMOB",
|
|
1734
|
+
format: "",
|
|
1735
|
+
adSourceName: "",
|
|
1736
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1737
|
+
});
|
|
1738
|
+
return params.onError(error);
|
|
1739
|
+
}
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
const { onEvent, onError, options } = params;
|
|
1743
|
+
const { adGroupId } = options;
|
|
1744
|
+
const referrer = getReferrer();
|
|
1745
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler3.invokeAppBridgeMethod(
|
|
1746
|
+
"loadTossAdOrAdmob",
|
|
1747
|
+
{ spaceUnitId: adGroupId, referrer, sessionId, sdkId },
|
|
1748
|
+
{
|
|
1749
|
+
onSuccess: () => {
|
|
1750
|
+
onEvent({ type: "loaded" });
|
|
1751
|
+
},
|
|
1752
|
+
onError: (error) => {
|
|
1753
|
+
onError(error);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
);
|
|
1757
|
+
return unregisterCallbacks;
|
|
1758
|
+
};
|
|
1759
|
+
fn.isSupported = GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1760
|
+
return fn;
|
|
1761
|
+
}
|
|
1762
|
+
var loadFullScreenAd = generateLoadFullScreenAd("107");
|
|
1763
|
+
var loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
|
|
1764
|
+
function showFullScreenAd(params) {
|
|
1765
|
+
if (!GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1766
|
+
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1767
|
+
return noop;
|
|
1768
|
+
}
|
|
1769
|
+
if (!integratedAdIsSupported()) {
|
|
1770
|
+
return GoogleAdMob.showAppsInTossAdMob({
|
|
1771
|
+
...params,
|
|
1772
|
+
onEvent: (event) => {
|
|
1773
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1774
|
+
switch (event.type) {
|
|
1775
|
+
case "show":
|
|
1776
|
+
postEventTracking({
|
|
1777
|
+
eventName: "SHOW",
|
|
1778
|
+
spaceUnitId: params.options.adGroupId,
|
|
1779
|
+
requestId,
|
|
1780
|
+
responseId: "",
|
|
1781
|
+
mediationType: "ADMOB",
|
|
1782
|
+
format: "",
|
|
1783
|
+
adSourceName: "",
|
|
1784
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1785
|
+
});
|
|
1786
|
+
break;
|
|
1787
|
+
case "failedToShow":
|
|
1788
|
+
postEventTracking({
|
|
1789
|
+
eventName: "FAILED_TO_SHOW",
|
|
1790
|
+
spaceUnitId: params.options.adGroupId,
|
|
1791
|
+
requestId,
|
|
1792
|
+
responseId: "",
|
|
1793
|
+
mediationType: "ADMOB",
|
|
1794
|
+
format: "",
|
|
1795
|
+
adSourceName: "",
|
|
1796
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1797
|
+
});
|
|
1798
|
+
break;
|
|
1799
|
+
case "impression":
|
|
1800
|
+
postEventTracking({
|
|
1801
|
+
eventName: "IMP",
|
|
1802
|
+
spaceUnitId: params.options.adGroupId,
|
|
1803
|
+
requestId,
|
|
1804
|
+
responseId: "",
|
|
1805
|
+
mediationType: "ADMOB",
|
|
1806
|
+
format: "",
|
|
1807
|
+
adSourceName: "",
|
|
1808
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1809
|
+
});
|
|
1810
|
+
break;
|
|
1811
|
+
case "clicked":
|
|
1812
|
+
postEventTracking({
|
|
1813
|
+
eventName: "CLICK",
|
|
1814
|
+
spaceUnitId: params.options.adGroupId,
|
|
1815
|
+
requestId,
|
|
1816
|
+
responseId: "",
|
|
1817
|
+
mediationType: "ADMOB",
|
|
1818
|
+
format: "",
|
|
1819
|
+
adSourceName: "",
|
|
1820
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1821
|
+
});
|
|
1822
|
+
break;
|
|
1823
|
+
case "dismissed":
|
|
1824
|
+
postEventTracking({
|
|
1825
|
+
eventName: "DISMISS",
|
|
1826
|
+
spaceUnitId: params.options.adGroupId,
|
|
1827
|
+
requestId,
|
|
1828
|
+
responseId: "",
|
|
1829
|
+
mediationType: "ADMOB",
|
|
1830
|
+
format: "",
|
|
1831
|
+
adSourceName: "",
|
|
1832
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1833
|
+
});
|
|
1834
|
+
break;
|
|
1835
|
+
case "userEarnedReward":
|
|
1836
|
+
postEventTracking({
|
|
1837
|
+
eventName: "USER_EARNED_REWARD",
|
|
1838
|
+
spaceUnitId: params.options.adGroupId,
|
|
1839
|
+
requestId,
|
|
1840
|
+
responseId: "",
|
|
1841
|
+
mediationType: "ADMOB",
|
|
1842
|
+
format: "",
|
|
1843
|
+
adSourceName: "",
|
|
1844
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1845
|
+
});
|
|
1846
|
+
break;
|
|
1847
|
+
}
|
|
1848
|
+
return params.onEvent(event);
|
|
1849
|
+
},
|
|
1850
|
+
onError: (error) => {
|
|
1851
|
+
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1852
|
+
postEventTracking({
|
|
1853
|
+
eventName: "FAILED_TO_SHOW",
|
|
1854
|
+
spaceUnitId: params.options.adGroupId,
|
|
1855
|
+
requestId,
|
|
1856
|
+
responseId: "",
|
|
1857
|
+
mediationType: "ADMOB",
|
|
1858
|
+
format: "",
|
|
1859
|
+
adSourceName: "",
|
|
1860
|
+
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1861
|
+
});
|
|
1862
|
+
return params.onError(error);
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
}
|
|
1866
|
+
const { onEvent, onError, options } = params;
|
|
1867
|
+
const { adGroupId } = options;
|
|
1868
|
+
const referrer = getReferrer();
|
|
1869
|
+
const unregisterCallbacks = INTERNAL__appBridgeHandler3.invokeAppBridgeMethod(
|
|
1870
|
+
"showTossAdOrAdmob",
|
|
1871
|
+
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1872
|
+
{
|
|
1873
|
+
onAdClicked: () => {
|
|
1874
|
+
onEvent({ type: "clicked" });
|
|
1875
|
+
},
|
|
1876
|
+
onAdDismissed: () => {
|
|
1877
|
+
onEvent({ type: "dismissed" });
|
|
1878
|
+
},
|
|
1879
|
+
onAdFailedToShow: () => {
|
|
1880
|
+
onEvent({ type: "failedToShow" });
|
|
1881
|
+
},
|
|
1882
|
+
onAdImpression: () => {
|
|
1883
|
+
onEvent({ type: "impression" });
|
|
1884
|
+
},
|
|
1885
|
+
onAdShow: () => {
|
|
1886
|
+
onEvent({ type: "show" });
|
|
1887
|
+
},
|
|
1888
|
+
onUserEarnedReward: (data) => {
|
|
1889
|
+
onEvent({ type: "userEarnedReward", data });
|
|
1890
|
+
},
|
|
1891
|
+
onSuccess: () => {
|
|
1892
|
+
onEvent({ type: "requested" });
|
|
1893
|
+
},
|
|
1894
|
+
onError: (error) => {
|
|
1895
|
+
onError(error);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
);
|
|
1899
|
+
return unregisterCallbacks;
|
|
1900
|
+
}
|
|
1901
|
+
showFullScreenAd.isSupported = GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
1902
|
+
|
|
1903
|
+
// src/ads/tossAdEventLog.ts
|
|
1904
|
+
import { INTERNAL__module as INTERNAL__module6 } from "@apps-in-toss/native-modules";
|
|
1905
|
+
import { Granite as Granite8 } from "@granite-js/react-native";
|
|
1906
|
+
async function tossAdEventLog(params) {
|
|
1907
|
+
const referrer = getReferrer();
|
|
1908
|
+
const appName = Granite8.appName;
|
|
1909
|
+
const eventLogParams = {
|
|
1910
|
+
...params,
|
|
1911
|
+
params: {
|
|
1912
|
+
...params.params,
|
|
1913
|
+
referrer,
|
|
1914
|
+
app_name: appName
|
|
1915
|
+
}
|
|
1916
|
+
};
|
|
1917
|
+
return INTERNAL__module6.tossCoreEventLog(eventLogParams);
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1582
1920
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1583
1921
|
import { useCallback as useCallback10, useEffect as useEffect10, useMemo as useMemo3, useRef as useRef4 } from "react";
|
|
1584
1922
|
function serializeError(error) {
|
|
@@ -1903,7 +2241,7 @@ function mergeRefs(...refs) {
|
|
|
1903
2241
|
}
|
|
1904
2242
|
|
|
1905
2243
|
// src/hooks/useCreateUserAgent.ts
|
|
1906
|
-
import { getPlatformOS, getTossAppVersion } from "@apps-in-toss/native-modules";
|
|
2244
|
+
import { getPlatformOS as getPlatformOS2, getTossAppVersion as getTossAppVersion2 } from "@apps-in-toss/native-modules";
|
|
1907
2245
|
import { useWindowDimensions } from "react-native";
|
|
1908
2246
|
var FontA11yCategory = {
|
|
1909
2247
|
Large: "Large",
|
|
@@ -2037,8 +2375,8 @@ function useCreateUserAgent({
|
|
|
2037
2375
|
safeArea,
|
|
2038
2376
|
safeAreaBottomTransparency
|
|
2039
2377
|
}) {
|
|
2040
|
-
const platform =
|
|
2041
|
-
const appVersion =
|
|
2378
|
+
const platform = getPlatformOS2();
|
|
2379
|
+
const appVersion = getTossAppVersion2();
|
|
2042
2380
|
const { fontScale } = useWindowDimensions();
|
|
2043
2381
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2044
2382
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
@@ -2122,9 +2460,45 @@ function useTopNavigation() {
|
|
|
2122
2460
|
};
|
|
2123
2461
|
}
|
|
2124
2462
|
|
|
2463
|
+
// src/hooks/useWebViewMemoryDebug.tsx
|
|
2464
|
+
import { getOperationalEnvironment as getOperationalEnvironment7, INTERNAL__module as INTERNAL__module7 } from "@apps-in-toss/native-modules";
|
|
2465
|
+
import { Granite as Granite9 } from "@granite-js/react-native";
|
|
2466
|
+
import { useToast } from "@toss/tds-react-native";
|
|
2467
|
+
function useHandleWebViewProcessDidTerminate(webViewRef) {
|
|
2468
|
+
const toast = useToast();
|
|
2469
|
+
return () => {
|
|
2470
|
+
webViewDebugLog("AppsInTossWebViewProcessDidTerminate", {});
|
|
2471
|
+
toast.open("\uBB38\uC81C\uAC00 \uC0DD\uACA8\uC11C \uBBF8\uB2C8\uC571\uC744 \uB2E4\uC2DC \uC2DC\uC791\uD588\uC5B4\uC694.", {
|
|
2472
|
+
type: "bottom",
|
|
2473
|
+
lottie: `https://static.toss.im/lotties-common/check-green-spot.json`
|
|
2474
|
+
});
|
|
2475
|
+
webViewRef.current?.reload();
|
|
2476
|
+
};
|
|
2477
|
+
}
|
|
2478
|
+
async function webViewMemoryDebugLog(params) {
|
|
2479
|
+
webViewDebugLog("AppsInTossWebViewMemoryDebug", params);
|
|
2480
|
+
}
|
|
2481
|
+
function webViewDebugLog(logName, params) {
|
|
2482
|
+
const global2 = getAppsInTossGlobals();
|
|
2483
|
+
const event = {
|
|
2484
|
+
log_name: logName,
|
|
2485
|
+
log_type: "debug",
|
|
2486
|
+
params: {
|
|
2487
|
+
...params,
|
|
2488
|
+
app_name: Granite9.appName,
|
|
2489
|
+
deployment_id: global2.deploymentId
|
|
2490
|
+
}
|
|
2491
|
+
};
|
|
2492
|
+
if (getOperationalEnvironment7() === "toss") {
|
|
2493
|
+
INTERNAL__module7.tossCoreEventLog(event);
|
|
2494
|
+
} else {
|
|
2495
|
+
console.log("[webViewDebugLog]", event);
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2125
2499
|
// src/utils/log.ts
|
|
2126
2500
|
import { eventLog as eventLogNative } from "@apps-in-toss/native-modules";
|
|
2127
|
-
import { getSchemeUri as
|
|
2501
|
+
import { getSchemeUri as getSchemeUri7 } from "@granite-js/react-native";
|
|
2128
2502
|
|
|
2129
2503
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2130
2504
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2148,9 +2522,9 @@ var getGroupId = (url) => {
|
|
|
2148
2522
|
};
|
|
2149
2523
|
}
|
|
2150
2524
|
};
|
|
2151
|
-
var
|
|
2525
|
+
var getReferrer2 = () => {
|
|
2152
2526
|
try {
|
|
2153
|
-
const referrer = new URL(
|
|
2527
|
+
const referrer = new URL(getSchemeUri7());
|
|
2154
2528
|
return referrer.searchParams.get("referrer");
|
|
2155
2529
|
} catch {
|
|
2156
2530
|
return "";
|
|
@@ -2163,7 +2537,7 @@ var trackScreen = (url) => {
|
|
|
2163
2537
|
log_name: `${groupId}::screen`,
|
|
2164
2538
|
params: {
|
|
2165
2539
|
search,
|
|
2166
|
-
referrer:
|
|
2540
|
+
referrer: getReferrer2(),
|
|
2167
2541
|
deployment_id: env.getDeploymentId(),
|
|
2168
2542
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2169
2543
|
}
|
|
@@ -2182,7 +2556,7 @@ var WEBVIEW_TYPES = {
|
|
|
2182
2556
|
};
|
|
2183
2557
|
function mergeSchemeQueryParamsInto(url) {
|
|
2184
2558
|
const baseUrl = new URL(url);
|
|
2185
|
-
const schemeUrl = new URL(
|
|
2559
|
+
const schemeUrl = new URL(getSchemeUri8());
|
|
2186
2560
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2187
2561
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2188
2562
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2239,13 +2613,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2239
2613
|
/** @internal */
|
|
2240
2614
|
appBridgeCallbackEvent: ({ onEvent, onError, options }) => appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2241
2615
|
/** AdMob */
|
|
2242
|
-
loadAdMobInterstitialAd:
|
|
2243
|
-
showAdMobInterstitialAd:
|
|
2244
|
-
loadAdMobRewardedAd:
|
|
2245
|
-
showAdMobRewardedAd:
|
|
2616
|
+
loadAdMobInterstitialAd: GoogleAdMob2.loadAdMobInterstitialAd,
|
|
2617
|
+
showAdMobInterstitialAd: GoogleAdMob2.showAdMobInterstitialAd,
|
|
2618
|
+
loadAdMobRewardedAd: GoogleAdMob2.loadAdMobRewardedAd,
|
|
2619
|
+
showAdMobRewardedAd: GoogleAdMob2.showAdMobRewardedAd,
|
|
2246
2620
|
/** AdMobV2 */
|
|
2247
|
-
loadAppsInTossAdMob:
|
|
2248
|
-
showAppsInTossAdMob:
|
|
2621
|
+
loadAppsInTossAdMob: GoogleAdMob2.loadAppsInTossAdMob,
|
|
2622
|
+
showAppsInTossAdMob: GoogleAdMob2.showAppsInTossAdMob,
|
|
2623
|
+
/** IntegratedAd */
|
|
2624
|
+
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
2625
|
+
showFullScreenAd,
|
|
2626
|
+
/** TossAd */
|
|
2627
|
+
fetchTossAd,
|
|
2249
2628
|
/** IAP */
|
|
2250
2629
|
iapCreateOneTimePurchaseOrder: IAP.createOneTimePurchaseOrder,
|
|
2251
2630
|
requestOneTimePurchase
|
|
@@ -2258,13 +2637,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2258
2637
|
getSafeAreaRight: () => insets.right,
|
|
2259
2638
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2260
2639
|
/** AdMob */
|
|
2261
|
-
loadAdMobInterstitialAd_isSupported:
|
|
2262
|
-
showAdMobInterstitialAd_isSupported:
|
|
2263
|
-
loadAdMobRewardedAd_isSupported:
|
|
2264
|
-
showAdMobRewardedAd_isSupported:
|
|
2640
|
+
loadAdMobInterstitialAd_isSupported: GoogleAdMob2.loadAdMobInterstitialAd.isSupported,
|
|
2641
|
+
showAdMobInterstitialAd_isSupported: GoogleAdMob2.showAdMobInterstitialAd.isSupported,
|
|
2642
|
+
loadAdMobRewardedAd_isSupported: GoogleAdMob2.loadAdMobRewardedAd.isSupported,
|
|
2643
|
+
showAdMobRewardedAd_isSupported: GoogleAdMob2.showAdMobRewardedAd.isSupported,
|
|
2265
2644
|
/** AdMobV2 */
|
|
2266
|
-
loadAppsInTossAdMob_isSupported:
|
|
2267
|
-
showAppsInTossAdMob_isSupported:
|
|
2645
|
+
loadAppsInTossAdMob_isSupported: GoogleAdMob2.loadAppsInTossAdMob.isSupported,
|
|
2646
|
+
showAppsInTossAdMob_isSupported: GoogleAdMob2.showAppsInTossAdMob.isSupported,
|
|
2647
|
+
/** IntegratedAd */
|
|
2648
|
+
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
2649
|
+
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
2650
|
+
/** TossAd */
|
|
2651
|
+
fetchTossAd_isSupported: fetchTossAd.isSupported,
|
|
2268
2652
|
/** env */
|
|
2269
2653
|
getDeploymentId: env.getDeploymentId
|
|
2270
2654
|
},
|
|
@@ -2297,7 +2681,11 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2297
2681
|
processProductGrant,
|
|
2298
2682
|
getPendingOrders: IAP.getPendingOrders,
|
|
2299
2683
|
getCompletedOrRefundedOrders: IAP.getCompletedOrRefundedOrders,
|
|
2300
|
-
completeProductGrant: IAP.completeProductGrant
|
|
2684
|
+
completeProductGrant: IAP.completeProductGrant,
|
|
2685
|
+
/** Toss Ads */
|
|
2686
|
+
tossAdEventLog,
|
|
2687
|
+
/** Private */
|
|
2688
|
+
memoryDebugLog: webViewMemoryDebugLog
|
|
2301
2689
|
}
|
|
2302
2690
|
});
|
|
2303
2691
|
const headerPropForExternalWebView = useMemo7(() => {
|
|
@@ -2330,6 +2718,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2330
2718
|
return () => BackHandler2.removeEventListener("hardwareBackPress", callback);
|
|
2331
2719
|
}, [webBackHandler]);
|
|
2332
2720
|
const globalScripts = useGlobalScripts();
|
|
2721
|
+
const handleWebViewProcessDidTerminate = useHandleWebViewProcessDidTerminate(webViewRef);
|
|
2333
2722
|
return /* @__PURE__ */ jsx18(
|
|
2334
2723
|
BaseWebView,
|
|
2335
2724
|
{
|
|
@@ -2375,7 +2764,17 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2375
2764
|
return false;
|
|
2376
2765
|
}
|
|
2377
2766
|
},
|
|
2378
|
-
originWhitelist: [
|
|
2767
|
+
originWhitelist: [
|
|
2768
|
+
"https://*",
|
|
2769
|
+
"http://*",
|
|
2770
|
+
"intoss://*",
|
|
2771
|
+
"intoss-private://*",
|
|
2772
|
+
"servicetoss://*",
|
|
2773
|
+
"supertoss://*",
|
|
2774
|
+
"intent://*"
|
|
2775
|
+
],
|
|
2776
|
+
onContentProcessDidTerminate: handleWebViewProcessDidTerminate,
|
|
2777
|
+
onRenderProcessGone: handleWebViewProcessDidTerminate
|
|
2379
2778
|
}
|
|
2380
2779
|
);
|
|
2381
2780
|
}
|
|
@@ -2459,6 +2858,8 @@ export {
|
|
|
2459
2858
|
OverlayProvider,
|
|
2460
2859
|
WebView,
|
|
2461
2860
|
env,
|
|
2861
|
+
loadFullScreenAd,
|
|
2862
|
+
showFullScreenAd,
|
|
2462
2863
|
useCreateUserAgent,
|
|
2463
2864
|
useGeolocation,
|
|
2464
2865
|
useOverlay3 as useOverlay,
|