@apps-in-toss/framework 0.0.0-dev.1765876894045 → 0.0.0-dev.1765878631929
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 +58 -436
- package/dist/index.d.cts +2 -68
- package/dist/index.d.ts +2 -68
- package/dist/index.js +24 -404
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -37,8 +37,6 @@ __export(src_exports, {
|
|
|
37
37
|
OverlayProvider: () => import_private10.OverlayProvider,
|
|
38
38
|
WebView: () => WebView,
|
|
39
39
|
env: () => env,
|
|
40
|
-
loadFullScreenAd: () => loadFullScreenAd,
|
|
41
|
-
showFullScreenAd: () => showFullScreenAd,
|
|
42
40
|
useCreateUserAgent: () => useCreateUserAgent,
|
|
43
41
|
useGeolocation: () => useGeolocation,
|
|
44
42
|
useOverlay: () => import_private10.useOverlay,
|
|
@@ -1419,16 +1417,16 @@ var AppsInToss = {
|
|
|
1419
1417
|
};
|
|
1420
1418
|
|
|
1421
1419
|
// src/components/WebView.tsx
|
|
1422
|
-
var
|
|
1420
|
+
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1423
1421
|
var appsInTossAsyncBridges = __toESM(require("@apps-in-toss/native-modules/async-bridges"), 1);
|
|
1424
1422
|
var appsInTossConstantBridges = __toESM(require("@apps-in-toss/native-modules/constant-bridges"), 1);
|
|
1425
1423
|
var appsInTossEventBridges = __toESM(require("@apps-in-toss/native-modules/event-bridges"), 1);
|
|
1426
1424
|
var import_react_native_safe_area_context4 = require("@granite-js/native/react-native-safe-area-context");
|
|
1427
|
-
var
|
|
1425
|
+
var import_react_native34 = require("@granite-js/react-native");
|
|
1428
1426
|
var import_tds_react_native14 = require("@toss/tds-react-native");
|
|
1429
1427
|
var import_private9 = require("@toss/tds-react-native/private");
|
|
1430
1428
|
var import_react28 = require("react");
|
|
1431
|
-
var
|
|
1429
|
+
var import_react_native35 = require("react-native");
|
|
1432
1430
|
|
|
1433
1431
|
// src/components/GameWebView.tsx
|
|
1434
1432
|
var import_native_modules14 = require("@apps-in-toss/native-modules");
|
|
@@ -1596,360 +1594,6 @@ function convertIntentURL(url) {
|
|
|
1596
1594
|
return `${scheme}://${url.hostname}${url.pathname}${url.search}`;
|
|
1597
1595
|
}
|
|
1598
1596
|
|
|
1599
|
-
// src/ads/fetchTossAd.ts
|
|
1600
|
-
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1601
|
-
|
|
1602
|
-
// ../../.yarn/cache/es-toolkit-npm-1.34.1-4cd6371dcb-aab6d07be3.zip/node_modules/es-toolkit/dist/function/noop.mjs
|
|
1603
|
-
function noop() {
|
|
1604
|
-
}
|
|
1605
|
-
|
|
1606
|
-
// src/ads/generateSessionId.ts
|
|
1607
|
-
function generateSessionId() {
|
|
1608
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
1609
|
-
const r = Math.random() * 16 | 0;
|
|
1610
|
-
const v = c === "x" ? r : r & 3 | 8;
|
|
1611
|
-
return v.toString(16);
|
|
1612
|
-
});
|
|
1613
|
-
}
|
|
1614
|
-
|
|
1615
|
-
// src/ads/constants.ts
|
|
1616
|
-
var sessionId = generateSessionId();
|
|
1617
|
-
|
|
1618
|
-
// src/ads/fetchTossAd.ts
|
|
1619
|
-
var ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1620
|
-
var IOS_FETCH_TOSS_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1621
|
-
var UNSUPPORTED_ERROR_MESSAGE = "This feature is not supported in the current environment";
|
|
1622
|
-
var ENVIRONMENT = (0, import_native_modules15.getOperationalEnvironment)();
|
|
1623
|
-
function fetchTossAd(params) {
|
|
1624
|
-
if (!fetchTossAd.isSupported()) {
|
|
1625
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE));
|
|
1626
|
-
return noop;
|
|
1627
|
-
}
|
|
1628
|
-
const { onEvent, onError, options } = params;
|
|
1629
|
-
const { adGroupId } = options;
|
|
1630
|
-
const unregisterCallbacks = import_native_modules15.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1631
|
-
"fetchTossAd",
|
|
1632
|
-
{ spaceUnitId: adGroupId, sessionId, sdkId: options.sdkId, availableStyleIds: options.availableStyleIds },
|
|
1633
|
-
{
|
|
1634
|
-
onSuccess: (response) => {
|
|
1635
|
-
onEvent(response);
|
|
1636
|
-
},
|
|
1637
|
-
onError: (error) => {
|
|
1638
|
-
onError(error);
|
|
1639
|
-
}
|
|
1640
|
-
}
|
|
1641
|
-
);
|
|
1642
|
-
return unregisterCallbacks;
|
|
1643
|
-
}
|
|
1644
|
-
fetchTossAd.isSupported = () => {
|
|
1645
|
-
if (ENVIRONMENT !== "toss") {
|
|
1646
|
-
return false;
|
|
1647
|
-
}
|
|
1648
|
-
return (0, import_native_modules15.isMinVersionSupported)({
|
|
1649
|
-
android: ANDROID_FETCH_TOSS_AD_SUPPORTED_VERSION,
|
|
1650
|
-
ios: IOS_FETCH_TOSS_AD_SUPPORTED_VERSION
|
|
1651
|
-
});
|
|
1652
|
-
};
|
|
1653
|
-
|
|
1654
|
-
// src/ads/integratedAd.ts
|
|
1655
|
-
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
1656
|
-
|
|
1657
|
-
// src/ads/generateRequestId.ts
|
|
1658
|
-
function generateRequestId() {
|
|
1659
|
-
const timestamp = Date.now().toString(36).toUpperCase();
|
|
1660
|
-
const random = Math.random().toString(36).substring(2, 7).toUpperCase();
|
|
1661
|
-
return `ait-${timestamp}${random}`;
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
|
-
// src/ads/getReferrer.ts
|
|
1665
|
-
var import_react_native29 = require("@granite-js/react-native");
|
|
1666
|
-
function getReferrer() {
|
|
1667
|
-
try {
|
|
1668
|
-
return new URL((0, import_react_native29.getSchemeUri)()).searchParams.get("referrer");
|
|
1669
|
-
} catch {
|
|
1670
|
-
return null;
|
|
1671
|
-
}
|
|
1672
|
-
}
|
|
1673
|
-
|
|
1674
|
-
// src/ads/remotes.ts
|
|
1675
|
-
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
1676
|
-
|
|
1677
|
-
// src/ads/getIsDev.ts
|
|
1678
|
-
var import_react_native30 = require("@granite-js/react-native");
|
|
1679
|
-
function getIsDev() {
|
|
1680
|
-
try {
|
|
1681
|
-
return new URL((0, import_react_native30.getSchemeUri)()).searchParams.get("isDev") === "true";
|
|
1682
|
-
} catch {
|
|
1683
|
-
return false;
|
|
1684
|
-
}
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
// src/ads/remotes.ts
|
|
1688
|
-
var OPERATIONAL_ENVIRONMENT = (0, import_native_modules16.getOperationalEnvironment)();
|
|
1689
|
-
var OS = (0, import_native_modules16.getPlatformOS)();
|
|
1690
|
-
var APP_VER = (0, import_native_modules16.getTossAppVersion)();
|
|
1691
|
-
var ALPHA_EVENT_TRACKER_HTTP_ENDPOINT = "https://alpha-trillion.toss.im/trk/sdk-mediation/event";
|
|
1692
|
-
var LIVE_EVENT_TRACKER_HTTP_ENDPOINT = "https://trillion.toss.im/trk/sdk-mediation/event";
|
|
1693
|
-
function getPostEventTrackingUrl() {
|
|
1694
|
-
const isDev = getIsDev();
|
|
1695
|
-
if (OPERATIONAL_ENVIRONMENT === "sandbox" || isDev) {
|
|
1696
|
-
return ALPHA_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1697
|
-
}
|
|
1698
|
-
return LIVE_EVENT_TRACKER_HTTP_ENDPOINT;
|
|
1699
|
-
}
|
|
1700
|
-
function postEventTracking(params) {
|
|
1701
|
-
const endpoint = getPostEventTrackingUrl();
|
|
1702
|
-
const bodyJSON = JSON.stringify({
|
|
1703
|
-
...params,
|
|
1704
|
-
os: OS,
|
|
1705
|
-
appVer: APP_VER,
|
|
1706
|
-
deviceIdType: "NONE",
|
|
1707
|
-
platform: "RN"
|
|
1708
|
-
});
|
|
1709
|
-
return fetch(
|
|
1710
|
-
endpoint,
|
|
1711
|
-
{
|
|
1712
|
-
method: "POST",
|
|
1713
|
-
headers: {
|
|
1714
|
-
"Content-Type": "application/json"
|
|
1715
|
-
},
|
|
1716
|
-
body: bodyJSON
|
|
1717
|
-
}
|
|
1718
|
-
).catch(noop);
|
|
1719
|
-
}
|
|
1720
|
-
|
|
1721
|
-
// src/ads/integratedAd.ts
|
|
1722
|
-
var INTEGRATED_AD_SDK_VERSION = "0.0.0";
|
|
1723
|
-
var ANDROID_INTEGRATED_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1724
|
-
var IOS_INTEGRATED_AD_SUPPORTED_VERSION = "5.241.0";
|
|
1725
|
-
var UNSUPPORTED_ERROR_MESSAGE2 = "This feature is not supported in the current environment";
|
|
1726
|
-
var INTG_AD_ADM_FALLBACK_RID_MAP = {};
|
|
1727
|
-
function integratedAdIsSupported() {
|
|
1728
|
-
return (0, import_native_modules17.isMinVersionSupported)({
|
|
1729
|
-
android: ANDROID_INTEGRATED_AD_SUPPORTED_VERSION,
|
|
1730
|
-
ios: IOS_INTEGRATED_AD_SUPPORTED_VERSION
|
|
1731
|
-
});
|
|
1732
|
-
}
|
|
1733
|
-
function generateLoadFullScreenAd(sdkId) {
|
|
1734
|
-
const fn = (params) => {
|
|
1735
|
-
if (!import_native_modules17.GoogleAdMob.loadAppsInTossAdMob.isSupported()) {
|
|
1736
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1737
|
-
return noop;
|
|
1738
|
-
}
|
|
1739
|
-
if (!integratedAdIsSupported()) {
|
|
1740
|
-
return import_native_modules17.GoogleAdMob.loadAppsInTossAdMob({
|
|
1741
|
-
...params,
|
|
1742
|
-
onEvent: (event) => {
|
|
1743
|
-
if (event.type === "loaded") {
|
|
1744
|
-
const requestId = generateRequestId();
|
|
1745
|
-
INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] = requestId;
|
|
1746
|
-
postEventTracking({
|
|
1747
|
-
eventName: "LOAD",
|
|
1748
|
-
spaceUnitId: params.options.adGroupId,
|
|
1749
|
-
requestId,
|
|
1750
|
-
responseId: event.data.responseInfo.responseId,
|
|
1751
|
-
mediationType: "ADMOB",
|
|
1752
|
-
format: "",
|
|
1753
|
-
adSourceName: event.data.responseInfo.loadedAdNetworkInfo?.adSourceName ?? "",
|
|
1754
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1755
|
-
});
|
|
1756
|
-
}
|
|
1757
|
-
return params.onEvent(event);
|
|
1758
|
-
},
|
|
1759
|
-
onError: (error) => {
|
|
1760
|
-
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1761
|
-
postEventTracking({
|
|
1762
|
-
eventName: "FAILED_TO_LOAD",
|
|
1763
|
-
spaceUnitId: params.options.adGroupId,
|
|
1764
|
-
requestId,
|
|
1765
|
-
responseId: "",
|
|
1766
|
-
mediationType: "ADMOB",
|
|
1767
|
-
format: "",
|
|
1768
|
-
adSourceName: "",
|
|
1769
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1770
|
-
});
|
|
1771
|
-
return params.onError(error);
|
|
1772
|
-
}
|
|
1773
|
-
});
|
|
1774
|
-
}
|
|
1775
|
-
const { onEvent, onError, options } = params;
|
|
1776
|
-
const { adGroupId } = options;
|
|
1777
|
-
const referrer = getReferrer();
|
|
1778
|
-
const unregisterCallbacks = import_native_modules17.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1779
|
-
"loadTossAdOrAdmob",
|
|
1780
|
-
{ spaceUnitId: adGroupId, referrer, sessionId, sdkId },
|
|
1781
|
-
{
|
|
1782
|
-
onSuccess: () => {
|
|
1783
|
-
onEvent({ type: "loaded" });
|
|
1784
|
-
},
|
|
1785
|
-
onError: (error) => {
|
|
1786
|
-
onError(error);
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
);
|
|
1790
|
-
return unregisterCallbacks;
|
|
1791
|
-
};
|
|
1792
|
-
fn.isSupported = import_native_modules17.GoogleAdMob.loadAppsInTossAdMob.isSupported;
|
|
1793
|
-
return fn;
|
|
1794
|
-
}
|
|
1795
|
-
var loadFullScreenAd = generateLoadFullScreenAd("107");
|
|
1796
|
-
var loadFullScreenAdForWeb = generateLoadFullScreenAd("107");
|
|
1797
|
-
function showFullScreenAd(params) {
|
|
1798
|
-
if (!import_native_modules17.GoogleAdMob.showAppsInTossAdMob.isSupported()) {
|
|
1799
|
-
params.onError(new Error(UNSUPPORTED_ERROR_MESSAGE2));
|
|
1800
|
-
return noop;
|
|
1801
|
-
}
|
|
1802
|
-
if (!integratedAdIsSupported()) {
|
|
1803
|
-
return import_native_modules17.GoogleAdMob.showAppsInTossAdMob({
|
|
1804
|
-
...params,
|
|
1805
|
-
onEvent: (event) => {
|
|
1806
|
-
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1807
|
-
switch (event.type) {
|
|
1808
|
-
case "show":
|
|
1809
|
-
postEventTracking({
|
|
1810
|
-
eventName: "SHOW",
|
|
1811
|
-
spaceUnitId: params.options.adGroupId,
|
|
1812
|
-
requestId,
|
|
1813
|
-
responseId: "",
|
|
1814
|
-
mediationType: "ADMOB",
|
|
1815
|
-
format: "",
|
|
1816
|
-
adSourceName: "",
|
|
1817
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1818
|
-
});
|
|
1819
|
-
break;
|
|
1820
|
-
case "failedToShow":
|
|
1821
|
-
postEventTracking({
|
|
1822
|
-
eventName: "FAILED_TO_SHOW",
|
|
1823
|
-
spaceUnitId: params.options.adGroupId,
|
|
1824
|
-
requestId,
|
|
1825
|
-
responseId: "",
|
|
1826
|
-
mediationType: "ADMOB",
|
|
1827
|
-
format: "",
|
|
1828
|
-
adSourceName: "",
|
|
1829
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1830
|
-
});
|
|
1831
|
-
break;
|
|
1832
|
-
case "impression":
|
|
1833
|
-
postEventTracking({
|
|
1834
|
-
eventName: "IMP",
|
|
1835
|
-
spaceUnitId: params.options.adGroupId,
|
|
1836
|
-
requestId,
|
|
1837
|
-
responseId: "",
|
|
1838
|
-
mediationType: "ADMOB",
|
|
1839
|
-
format: "",
|
|
1840
|
-
adSourceName: "",
|
|
1841
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1842
|
-
});
|
|
1843
|
-
break;
|
|
1844
|
-
case "clicked":
|
|
1845
|
-
postEventTracking({
|
|
1846
|
-
eventName: "CLICK",
|
|
1847
|
-
spaceUnitId: params.options.adGroupId,
|
|
1848
|
-
requestId,
|
|
1849
|
-
responseId: "",
|
|
1850
|
-
mediationType: "ADMOB",
|
|
1851
|
-
format: "",
|
|
1852
|
-
adSourceName: "",
|
|
1853
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1854
|
-
});
|
|
1855
|
-
break;
|
|
1856
|
-
case "dismissed":
|
|
1857
|
-
postEventTracking({
|
|
1858
|
-
eventName: "DISMISS",
|
|
1859
|
-
spaceUnitId: params.options.adGroupId,
|
|
1860
|
-
requestId,
|
|
1861
|
-
responseId: "",
|
|
1862
|
-
mediationType: "ADMOB",
|
|
1863
|
-
format: "",
|
|
1864
|
-
adSourceName: "",
|
|
1865
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1866
|
-
});
|
|
1867
|
-
break;
|
|
1868
|
-
case "userEarnedReward":
|
|
1869
|
-
postEventTracking({
|
|
1870
|
-
eventName: "USER_EARNED_REWARD",
|
|
1871
|
-
spaceUnitId: params.options.adGroupId,
|
|
1872
|
-
requestId,
|
|
1873
|
-
responseId: "",
|
|
1874
|
-
mediationType: "ADMOB",
|
|
1875
|
-
format: "",
|
|
1876
|
-
adSourceName: "",
|
|
1877
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1878
|
-
});
|
|
1879
|
-
break;
|
|
1880
|
-
}
|
|
1881
|
-
return params.onEvent(event);
|
|
1882
|
-
},
|
|
1883
|
-
onError: (error) => {
|
|
1884
|
-
const requestId = INTG_AD_ADM_FALLBACK_RID_MAP[params.options.adGroupId] ?? "";
|
|
1885
|
-
postEventTracking({
|
|
1886
|
-
eventName: "FAILED_TO_SHOW",
|
|
1887
|
-
spaceUnitId: params.options.adGroupId,
|
|
1888
|
-
requestId,
|
|
1889
|
-
responseId: "",
|
|
1890
|
-
mediationType: "ADMOB",
|
|
1891
|
-
format: "",
|
|
1892
|
-
adSourceName: "",
|
|
1893
|
-
sdkVer: INTEGRATED_AD_SDK_VERSION
|
|
1894
|
-
});
|
|
1895
|
-
return params.onError(error);
|
|
1896
|
-
}
|
|
1897
|
-
});
|
|
1898
|
-
}
|
|
1899
|
-
const { onEvent, onError, options } = params;
|
|
1900
|
-
const { adGroupId } = options;
|
|
1901
|
-
const referrer = getReferrer();
|
|
1902
|
-
const unregisterCallbacks = import_native_modules17.INTERNAL__appBridgeHandler.invokeAppBridgeMethod(
|
|
1903
|
-
"showTossAdOrAdmob",
|
|
1904
|
-
{ spaceUnitId: adGroupId, referrer, sessionId },
|
|
1905
|
-
{
|
|
1906
|
-
onAdClicked: () => {
|
|
1907
|
-
onEvent({ type: "clicked" });
|
|
1908
|
-
},
|
|
1909
|
-
onAdDismissed: () => {
|
|
1910
|
-
onEvent({ type: "dismissed" });
|
|
1911
|
-
},
|
|
1912
|
-
onAdFailedToShow: () => {
|
|
1913
|
-
onEvent({ type: "failedToShow" });
|
|
1914
|
-
},
|
|
1915
|
-
onAdImpression: () => {
|
|
1916
|
-
onEvent({ type: "impression" });
|
|
1917
|
-
},
|
|
1918
|
-
onAdShow: () => {
|
|
1919
|
-
onEvent({ type: "show" });
|
|
1920
|
-
},
|
|
1921
|
-
onUserEarnedReward: (data) => {
|
|
1922
|
-
onEvent({ type: "userEarnedReward", data });
|
|
1923
|
-
},
|
|
1924
|
-
onSuccess: () => {
|
|
1925
|
-
onEvent({ type: "requested" });
|
|
1926
|
-
},
|
|
1927
|
-
onError: (error) => {
|
|
1928
|
-
onError(error);
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
);
|
|
1932
|
-
return unregisterCallbacks;
|
|
1933
|
-
}
|
|
1934
|
-
showFullScreenAd.isSupported = import_native_modules17.GoogleAdMob.showAppsInTossAdMob.isSupported;
|
|
1935
|
-
|
|
1936
|
-
// src/ads/tossAdEventLog.ts
|
|
1937
|
-
var import_native_modules18 = require("@apps-in-toss/native-modules");
|
|
1938
|
-
var import_react_native31 = require("@granite-js/react-native");
|
|
1939
|
-
async function tossAdEventLog(params) {
|
|
1940
|
-
const referrer = getReferrer();
|
|
1941
|
-
const appName = import_react_native31.Granite.appName;
|
|
1942
|
-
const eventLogParams = {
|
|
1943
|
-
...params,
|
|
1944
|
-
params: {
|
|
1945
|
-
...params.params,
|
|
1946
|
-
referrer,
|
|
1947
|
-
app_name: appName
|
|
1948
|
-
}
|
|
1949
|
-
};
|
|
1950
|
-
return import_native_modules18.INTERNAL__module.tossCoreEventLog(eventLogParams);
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
1597
|
// src/bridge-handler/useBridgeHandler.tsx
|
|
1954
1598
|
var import_react22 = require("react");
|
|
1955
1599
|
function serializeError(error) {
|
|
@@ -2125,7 +1769,7 @@ function useSafeAreaInsetsEmitter() {
|
|
|
2125
1769
|
}
|
|
2126
1770
|
|
|
2127
1771
|
// src/core/hooks/useWebBackHandler.tsx
|
|
2128
|
-
var
|
|
1772
|
+
var import_react_native29 = require("@granite-js/react-native");
|
|
2129
1773
|
var import_tds_react_native13 = require("@toss/tds-react-native");
|
|
2130
1774
|
var import_es_hangul5 = require("es-hangul");
|
|
2131
1775
|
var import_react25 = require("react");
|
|
@@ -2195,7 +1839,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
2195
1839
|
hasBackEvent: hasWebBackEvent,
|
|
2196
1840
|
addEventListener: addWebBackEventListener,
|
|
2197
1841
|
removeEventListener: removeWebBackEventListener
|
|
2198
|
-
} = (0,
|
|
1842
|
+
} = (0, import_react_native29.useBackEventState)();
|
|
2199
1843
|
const logging = useNavigationBarLogging();
|
|
2200
1844
|
const { openConfirm } = (0, import_tds_react_native13.useDialog)();
|
|
2201
1845
|
const global2 = getAppsInTossGlobals();
|
|
@@ -2231,7 +1875,7 @@ function useWebBackHandler(webViewRef) {
|
|
|
2231
1875
|
logging.closePopupCtaClick(isConfirmed);
|
|
2232
1876
|
if (isConfirmed) {
|
|
2233
1877
|
captureExitLog(Date.now());
|
|
2234
|
-
(0,
|
|
1878
|
+
(0, import_react_native29.closeView)();
|
|
2235
1879
|
}
|
|
2236
1880
|
}
|
|
2237
1881
|
}, [
|
|
@@ -2274,8 +1918,8 @@ function mergeRefs(...refs) {
|
|
|
2274
1918
|
}
|
|
2275
1919
|
|
|
2276
1920
|
// src/hooks/useCreateUserAgent.ts
|
|
2277
|
-
var
|
|
2278
|
-
var
|
|
1921
|
+
var import_native_modules15 = require("@apps-in-toss/native-modules");
|
|
1922
|
+
var import_react_native30 = require("react-native");
|
|
2279
1923
|
var FontA11yCategory = {
|
|
2280
1924
|
Large: "Large",
|
|
2281
1925
|
xLarge: "xLarge",
|
|
@@ -2408,9 +2052,9 @@ function useCreateUserAgent({
|
|
|
2408
2052
|
safeArea,
|
|
2409
2053
|
safeAreaBottomTransparency
|
|
2410
2054
|
}) {
|
|
2411
|
-
const platform = (0,
|
|
2412
|
-
const appVersion = (0,
|
|
2413
|
-
const { fontScale } = (0,
|
|
2055
|
+
const platform = (0, import_native_modules15.getPlatformOS)();
|
|
2056
|
+
const appVersion = (0, import_native_modules15.getTossAppVersion)();
|
|
2057
|
+
const { fontScale } = (0, import_react_native30.useWindowDimensions)();
|
|
2414
2058
|
const platformString = platform === "ios" ? "iPhone" : "Android phone";
|
|
2415
2059
|
const fontA11y = mapFontScaleToCategory(fontScale, platform);
|
|
2416
2060
|
const normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
|
|
@@ -2431,17 +2075,17 @@ function useCreateUserAgent({
|
|
|
2431
2075
|
}
|
|
2432
2076
|
|
|
2433
2077
|
// src/hooks/useGeolocation.ts
|
|
2434
|
-
var
|
|
2435
|
-
var
|
|
2078
|
+
var import_native_modules16 = require("@apps-in-toss/native-modules");
|
|
2079
|
+
var import_react_native31 = require("@granite-js/react-native");
|
|
2436
2080
|
var import_react26 = require("react");
|
|
2437
2081
|
function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
2438
|
-
const isVisible = (0,
|
|
2082
|
+
const isVisible = (0, import_react_native31.useVisibility)();
|
|
2439
2083
|
const [location, setLocation] = (0, import_react26.useState)(null);
|
|
2440
2084
|
(0, import_react26.useEffect)(() => {
|
|
2441
2085
|
if (!isVisible) {
|
|
2442
2086
|
return;
|
|
2443
2087
|
}
|
|
2444
|
-
return (0,
|
|
2088
|
+
return (0, import_native_modules16.startUpdateLocation)({
|
|
2445
2089
|
options: {
|
|
2446
2090
|
accuracy,
|
|
2447
2091
|
distanceInterval,
|
|
@@ -2455,11 +2099,11 @@ function useGeolocation({ accuracy, distanceInterval, timeInterval }) {
|
|
|
2455
2099
|
}
|
|
2456
2100
|
|
|
2457
2101
|
// src/hooks/useWaitForReturnNavigator.tsx
|
|
2458
|
-
var
|
|
2102
|
+
var import_react_native32 = require("@granite-js/react-native");
|
|
2459
2103
|
var import_react27 = require("react");
|
|
2460
2104
|
function useWaitForReturnNavigator() {
|
|
2461
2105
|
const callbacks = (0, import_react27.useRef)([]).current;
|
|
2462
|
-
const navigation = (0,
|
|
2106
|
+
const navigation = (0, import_react_native32.useNavigation)();
|
|
2463
2107
|
const startNavigating = (0, import_react27.useCallback)(
|
|
2464
2108
|
(route, params) => {
|
|
2465
2109
|
return new Promise((resolve) => {
|
|
@@ -2480,7 +2124,7 @@ function useWaitForReturnNavigator() {
|
|
|
2480
2124
|
},
|
|
2481
2125
|
[callbacks]
|
|
2482
2126
|
);
|
|
2483
|
-
(0,
|
|
2127
|
+
(0, import_react_native32.useVisibilityChange)(handleVisibilityChange);
|
|
2484
2128
|
return startNavigating;
|
|
2485
2129
|
}
|
|
2486
2130
|
|
|
@@ -2494,8 +2138,8 @@ function useTopNavigation() {
|
|
|
2494
2138
|
}
|
|
2495
2139
|
|
|
2496
2140
|
// src/utils/log.ts
|
|
2497
|
-
var
|
|
2498
|
-
var
|
|
2141
|
+
var import_native_modules17 = require("@apps-in-toss/native-modules");
|
|
2142
|
+
var import_react_native33 = require("@granite-js/react-native");
|
|
2499
2143
|
|
|
2500
2144
|
// src/utils/extractDateFromUUIDv7.ts
|
|
2501
2145
|
var extractDateFromUUIDv7 = (uuid) => {
|
|
@@ -2519,9 +2163,9 @@ var getGroupId = (url) => {
|
|
|
2519
2163
|
};
|
|
2520
2164
|
}
|
|
2521
2165
|
};
|
|
2522
|
-
var
|
|
2166
|
+
var getReferrer = () => {
|
|
2523
2167
|
try {
|
|
2524
|
-
const referrer = new URL((0,
|
|
2168
|
+
const referrer = new URL((0, import_react_native33.getSchemeUri)());
|
|
2525
2169
|
return referrer.searchParams.get("referrer");
|
|
2526
2170
|
} catch {
|
|
2527
2171
|
return "";
|
|
@@ -2534,12 +2178,12 @@ var trackScreen = (url) => {
|
|
|
2534
2178
|
log_name: `${groupId}::screen`,
|
|
2535
2179
|
params: {
|
|
2536
2180
|
search,
|
|
2537
|
-
referrer:
|
|
2181
|
+
referrer: getReferrer(),
|
|
2538
2182
|
deployment_id: env.getDeploymentId(),
|
|
2539
2183
|
deployment_timestamp: extractDateFromUUIDv7(env.getDeploymentId()).getTime()
|
|
2540
2184
|
}
|
|
2541
2185
|
};
|
|
2542
|
-
return (0,
|
|
2186
|
+
return (0, import_native_modules17.eventLog)(log);
|
|
2543
2187
|
};
|
|
2544
2188
|
|
|
2545
2189
|
// src/components/WebView.tsx
|
|
@@ -2553,7 +2197,7 @@ var WEBVIEW_TYPES = {
|
|
|
2553
2197
|
};
|
|
2554
2198
|
function mergeSchemeQueryParamsInto(url) {
|
|
2555
2199
|
const baseUrl = new URL(url);
|
|
2556
|
-
const schemeUrl = new URL((0,
|
|
2200
|
+
const schemeUrl = new URL((0, import_react_native34.getSchemeUri)());
|
|
2557
2201
|
baseUrl.pathname = schemeUrl.pathname;
|
|
2558
2202
|
for (const [key, value] of schemeUrl.searchParams.entries()) {
|
|
2559
2203
|
baseUrl.searchParams.set(key, value);
|
|
@@ -2565,7 +2209,7 @@ function getWebViewUri(local) {
|
|
|
2565
2209
|
const devUrl = `http://${local.host}:${local.port}`;
|
|
2566
2210
|
return mergeSchemeQueryParamsInto(devUrl).toString();
|
|
2567
2211
|
}
|
|
2568
|
-
const { url: rawUrl } =
|
|
2212
|
+
const { url: rawUrl } = import_native_modules18.AppsInTossModule.getWebBundleURL({});
|
|
2569
2213
|
const url = mergeSchemeQueryParamsInto(rawUrl);
|
|
2570
2214
|
const deploymentId = env.getDeploymentId();
|
|
2571
2215
|
if (deploymentId) {
|
|
@@ -2600,7 +2244,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2600
2244
|
webBackHandler.removeEventListener(onEvent);
|
|
2601
2245
|
};
|
|
2602
2246
|
},
|
|
2603
|
-
updateLocationEvent: ({ onEvent, onError, options }) =>
|
|
2247
|
+
updateLocationEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("updateLocationEvent", { onEvent, onError, options }),
|
|
2604
2248
|
safeAreaInsetsChange: ({ onEvent }) => {
|
|
2605
2249
|
safeAreaInsetsEmitter.on("safeAreaInsetsChange", onEvent);
|
|
2606
2250
|
return () => {
|
|
@@ -2608,23 +2252,18 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2608
2252
|
};
|
|
2609
2253
|
},
|
|
2610
2254
|
/** @internal */
|
|
2611
|
-
appBridgeCallbackEvent: ({ onEvent, onError, options }) =>
|
|
2255
|
+
appBridgeCallbackEvent: ({ onEvent, onError, options }) => import_native_modules18.appsInTossEvent.addEventListener("appBridgeCallbackEvent", { onEvent, onError, options }),
|
|
2612
2256
|
/** AdMob */
|
|
2613
|
-
loadAdMobInterstitialAd:
|
|
2614
|
-
showAdMobInterstitialAd:
|
|
2615
|
-
loadAdMobRewardedAd:
|
|
2616
|
-
showAdMobRewardedAd:
|
|
2257
|
+
loadAdMobInterstitialAd: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd,
|
|
2258
|
+
showAdMobInterstitialAd: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd,
|
|
2259
|
+
loadAdMobRewardedAd: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd,
|
|
2260
|
+
showAdMobRewardedAd: import_native_modules18.GoogleAdMob.showAdMobRewardedAd,
|
|
2617
2261
|
/** AdMobV2 */
|
|
2618
|
-
loadAppsInTossAdMob:
|
|
2619
|
-
showAppsInTossAdMob:
|
|
2620
|
-
/** IntegratedAd */
|
|
2621
|
-
loadFullScreenAd: loadFullScreenAdForWeb,
|
|
2622
|
-
showFullScreenAd,
|
|
2623
|
-
/** TossAd */
|
|
2624
|
-
fetchTossAd,
|
|
2262
|
+
loadAppsInTossAdMob: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob,
|
|
2263
|
+
showAppsInTossAdMob: import_native_modules18.GoogleAdMob.showAppsInTossAdMob,
|
|
2625
2264
|
/** IAP */
|
|
2626
|
-
iapCreateOneTimePurchaseOrder:
|
|
2627
|
-
requestOneTimePurchase:
|
|
2265
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.IAP.createOneTimePurchaseOrder,
|
|
2266
|
+
requestOneTimePurchase: import_native_modules18.requestOneTimePurchase
|
|
2628
2267
|
},
|
|
2629
2268
|
constantHandlerMap: {
|
|
2630
2269
|
...appsInTossConstantBridges,
|
|
@@ -2634,18 +2273,13 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2634
2273
|
getSafeAreaRight: () => insets.right,
|
|
2635
2274
|
...Object.fromEntries(Object.entries(global2).map(([key, value]) => [key, () => value])),
|
|
2636
2275
|
/** AdMob */
|
|
2637
|
-
loadAdMobInterstitialAd_isSupported:
|
|
2638
|
-
showAdMobInterstitialAd_isSupported:
|
|
2639
|
-
loadAdMobRewardedAd_isSupported:
|
|
2640
|
-
showAdMobRewardedAd_isSupported:
|
|
2276
|
+
loadAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobInterstitialAd.isSupported,
|
|
2277
|
+
showAdMobInterstitialAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobInterstitialAd.isSupported,
|
|
2278
|
+
loadAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.loadAdMobRewardedAd.isSupported,
|
|
2279
|
+
showAdMobRewardedAd_isSupported: import_native_modules18.GoogleAdMob.showAdMobRewardedAd.isSupported,
|
|
2641
2280
|
/** AdMobV2 */
|
|
2642
|
-
loadAppsInTossAdMob_isSupported:
|
|
2643
|
-
showAppsInTossAdMob_isSupported:
|
|
2644
|
-
/** IntegratedAd */
|
|
2645
|
-
loadFullScreenAd_isSupported: loadFullScreenAdForWeb.isSupported,
|
|
2646
|
-
showFullScreenAd_isSupported: showFullScreenAd.isSupported,
|
|
2647
|
-
/** TossAd */
|
|
2648
|
-
fetchTossAd_isSupported: fetchTossAd.isSupported,
|
|
2281
|
+
loadAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.loadAppsInTossAdMob.isSupported,
|
|
2282
|
+
showAppsInTossAdMob_isSupported: import_native_modules18.GoogleAdMob.showAppsInTossAdMob.isSupported,
|
|
2649
2283
|
/** env */
|
|
2650
2284
|
getDeploymentId: env.getDeploymentId
|
|
2651
2285
|
},
|
|
@@ -2668,19 +2302,17 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2668
2302
|
getCurrentLocation: appsInTossAsyncBridges.getCurrentLocation,
|
|
2669
2303
|
openCamera: appsInTossAsyncBridges.openCamera,
|
|
2670
2304
|
/** Storage */
|
|
2671
|
-
getStorageItem:
|
|
2672
|
-
setStorageItem:
|
|
2673
|
-
removeStorageItem:
|
|
2674
|
-
clearItems:
|
|
2305
|
+
getStorageItem: import_native_modules18.Storage.getItem,
|
|
2306
|
+
setStorageItem: import_native_modules18.Storage.setItem,
|
|
2307
|
+
removeStorageItem: import_native_modules18.Storage.removeItem,
|
|
2308
|
+
clearItems: import_native_modules18.Storage.clearItems,
|
|
2675
2309
|
/** IAP */
|
|
2676
|
-
iapGetProductItemList:
|
|
2677
|
-
iapCreateOneTimePurchaseOrder:
|
|
2678
|
-
processProductGrant:
|
|
2679
|
-
getPendingOrders:
|
|
2680
|
-
getCompletedOrRefundedOrders:
|
|
2681
|
-
completeProductGrant:
|
|
2682
|
-
/** Toss Ads */
|
|
2683
|
-
tossAdEventLog
|
|
2310
|
+
iapGetProductItemList: import_native_modules18.IAP.getProductItemList,
|
|
2311
|
+
iapCreateOneTimePurchaseOrder: import_native_modules18.iapCreateOneTimePurchaseOrder,
|
|
2312
|
+
processProductGrant: import_native_modules18.processProductGrant,
|
|
2313
|
+
getPendingOrders: import_native_modules18.IAP.getPendingOrders,
|
|
2314
|
+
getCompletedOrRefundedOrders: import_native_modules18.IAP.getCompletedOrRefundedOrders,
|
|
2315
|
+
completeProductGrant: import_native_modules18.IAP.completeProductGrant
|
|
2684
2316
|
}
|
|
2685
2317
|
});
|
|
2686
2318
|
const headerPropForExternalWebView = (0, import_react28.useMemo)(() => {
|
|
@@ -2709,8 +2341,8 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2709
2341
|
webBackHandler.handleWebBack();
|
|
2710
2342
|
return true;
|
|
2711
2343
|
};
|
|
2712
|
-
|
|
2713
|
-
return () =>
|
|
2344
|
+
import_react_native35.BackHandler.addEventListener("hardwareBackPress", callback);
|
|
2345
|
+
return () => import_react_native35.BackHandler.removeEventListener("hardwareBackPress", callback);
|
|
2714
2346
|
}, [webBackHandler]);
|
|
2715
2347
|
const globalScripts = useGlobalScripts();
|
|
2716
2348
|
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
@@ -2735,14 +2367,14 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2735
2367
|
props.onNavigationStateChange?.(event);
|
|
2736
2368
|
webBackHandler.onNavigationStateChange(event);
|
|
2737
2369
|
},
|
|
2738
|
-
userAgent:
|
|
2370
|
+
userAgent: import_react_native35.Platform.OS === "ios" ? userAgent : void 0,
|
|
2739
2371
|
sharedCookiesEnabled: true,
|
|
2740
2372
|
webviewDebuggingEnabled: webViewDebuggingEnabled,
|
|
2741
2373
|
thirdPartyCookiesEnabled: true,
|
|
2742
2374
|
onMessage: handler.onMessage,
|
|
2743
2375
|
injectedJavaScript: globalScripts.afterLoad,
|
|
2744
2376
|
injectedJavaScriptBeforeContentLoaded: mergeScripts(handler.injectedJavaScript, globalScripts.beforeLoad),
|
|
2745
|
-
decelerationRate:
|
|
2377
|
+
decelerationRate: import_react_native35.Platform.OS === "ios" ? 1 : void 0,
|
|
2746
2378
|
allowsBackForwardNavigationGestures,
|
|
2747
2379
|
onShouldStartLoadWithRequest: (event) => {
|
|
2748
2380
|
try {
|
|
@@ -2750,7 +2382,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2750
2382
|
if (["https:", "http:"].includes(url.protocol)) {
|
|
2751
2383
|
return true;
|
|
2752
2384
|
} else {
|
|
2753
|
-
|
|
2385
|
+
import_react_native35.Linking.openURL(convertIntentURL(url) ?? url.href);
|
|
2754
2386
|
return false;
|
|
2755
2387
|
}
|
|
2756
2388
|
} catch (error) {
|
|
@@ -2758,15 +2390,7 @@ function WebView({ type, local, onMessage, ...props }) {
|
|
|
2758
2390
|
return false;
|
|
2759
2391
|
}
|
|
2760
2392
|
},
|
|
2761
|
-
originWhitelist: [
|
|
2762
|
-
"https://*",
|
|
2763
|
-
"http://*",
|
|
2764
|
-
"intoss://*",
|
|
2765
|
-
"intoss-private://*",
|
|
2766
|
-
"servicetoss://*",
|
|
2767
|
-
"supertoss://*",
|
|
2768
|
-
"intent://*"
|
|
2769
|
-
]
|
|
2393
|
+
originWhitelist: ["https://*", "http://*", "intoss://*", "intoss-private://*", "servicetoss://*", "supertoss://*", "intent://*"]
|
|
2770
2394
|
}
|
|
2771
2395
|
);
|
|
2772
2396
|
}
|
|
@@ -2851,8 +2475,6 @@ var Analytics2 = {
|
|
|
2851
2475
|
OverlayProvider,
|
|
2852
2476
|
WebView,
|
|
2853
2477
|
env,
|
|
2854
|
-
loadFullScreenAd,
|
|
2855
|
-
showFullScreenAd,
|
|
2856
2478
|
useCreateUserAgent,
|
|
2857
2479
|
useGeolocation,
|
|
2858
2480
|
useOverlay,
|