mainview deeplink 정보 노출 확인

This commit is contained in:
opacity@t-win.kr
2025-08-28 15:09:13 +09:00
parent 44d3c05678
commit 83b62d87e9
2 changed files with 42 additions and 40 deletions

View File

@@ -35,6 +35,7 @@ import {
getSystemSettings, getSystemSettings,
checkFirstLaunch, checkFirstLaunch,
setDeepLink, setDeepLink,
setDeepLinkDebug,
setGNBMenu, setGNBMenu,
setSecondLayerInfo, setSecondLayerInfo,
} from "../actions/commonActions"; } from "../actions/commonActions";
@@ -252,7 +253,45 @@ function AppBase(props) {
dispatch(getMyUpcomingAlertShow()); dispatch(getMyUpcomingAlertShow());
} }
const launchParams = getLaunchParams(dispatch); const launchParams = getLaunchParams();
// 디버그 정보 직접 수집
let debugInfo = {
rawLaunchParams: "",
parsedParams: null,
finalParams: null,
containerLaunch: false,
parseError: null,
};
if (
typeof window === "object" &&
window.PalmSystem &&
window.PalmSystem.launchParams
) {
try {
debugInfo.rawLaunchParams = window.PalmSystem.launchParams;
const parsed = JSON.parse(window.PalmSystem.launchParams);
debugInfo.parsedParams = JSON.parse(JSON.stringify(parsed));
if (parsed["x-webos-app-container-launch"] === true) {
debugInfo.containerLaunch = true;
debugInfo.finalParams = JSON.parse(
JSON.stringify(parsed.details || {})
);
} else {
debugInfo.finalParams = JSON.parse(JSON.stringify(parsed));
}
} catch (e) {
debugInfo.parseError = e.message;
}
} else {
debugInfo.rawLaunchParams = "No PalmSystem or launchParams available";
debugInfo.finalParams = {};
}
// 디버그 정보 dispatch
dispatch(setDeepLinkDebug(debugInfo));
console.log( console.log(
"initService...{haveyInit, launchParams}", "initService...{haveyInit, launchParams}",
@@ -457,7 +496,7 @@ function AppBase(props) {
}, [introTermsAgree, deviceRegistered, dispatch, initService, termsLoading]); }, [introTermsAgree, deviceRegistered, dispatch, initService, termsLoading]);
useEffect(() => { useEffect(() => {
const launchParmas = getLaunchParams(dispatch); const launchParmas = getLaunchParams();
const linkTpNm = launchParmas.contentTarget const linkTpNm = launchParmas.contentTarget
? launchParmas.contentTarget.split("_")[2] || "" ? launchParmas.contentTarget.split("_")[2] || ""
: Config.LOG_MENU.APP; : Config.LOG_MENU.APP;

View File

@@ -147,15 +147,8 @@ let localLaunchParams = {
// contentTarget: "V3_2001_HOMEBANNER:1240712_TM_10", // contentTarget: "V3_2001_HOMEBANNER:1240712_TM_10",
}; };
export const getLaunchParams = (dispatch = null) => { export const getLaunchParams = () => {
let params = {}; let params = {};
let debugInfo = {
rawLaunchParams: "",
parsedParams: null,
finalParams: null,
containerLaunch: false,
parseError: null,
};
if ( if (
typeof window === "object" && typeof window === "object" &&
@@ -163,16 +156,13 @@ export const getLaunchParams = (dispatch = null) => {
window.PalmSystem.launchParams window.PalmSystem.launchParams
) { ) {
try { try {
debugInfo.rawLaunchParams = window.PalmSystem.launchParams;
console.log("[DEBUG] Raw launchParams:", window.PalmSystem.launchParams); console.log("[DEBUG] Raw launchParams:", window.PalmSystem.launchParams);
params = JSON.parse(window.PalmSystem.launchParams); params = JSON.parse(window.PalmSystem.launchParams);
debugInfo.parsedParams = JSON.parse(JSON.stringify(params));
console.log("[DEBUG] Parsed params:", JSON.stringify(params, null, 2)); console.log("[DEBUG] Parsed params:", JSON.stringify(params, null, 2));
if (params["x-webos-app-container-launch"] === true) { if (params["x-webos-app-container-launch"] === true) {
debugInfo.containerLaunch = true;
console.log( console.log(
"[DEBUG] Container launch detected, extracting details:", "[DEBUG] Container launch detected, extracting details:",
params.details params.details
@@ -180,41 +170,14 @@ export const getLaunchParams = (dispatch = null) => {
params = params.details || {}; params = params.details || {};
} }
debugInfo.finalParams = JSON.parse(JSON.stringify(params));
console.log("[DEBUG] Final params:", JSON.stringify(params, null, 2)); console.log("[DEBUG] Final params:", JSON.stringify(params, null, 2));
} catch (e) { } catch (e) {
console.log("[DEBUG] LaunchParams parsing error:", e); console.log("[DEBUG] LaunchParams parsing error:", e);
debugInfo.parseError = e.message;
params = {}; params = {};
} }
// Redux dispatch가 전달된 경우 디버그 정보 저장
if (dispatch && typeof dispatch === "function") {
try {
const { setDeepLinkDebug } = require("../actions/commonActions");
dispatch(setDeepLinkDebug(debugInfo));
} catch (importError) {
console.log("[DEBUG] Failed to dispatch debug info:", importError);
}
}
return params; return params;
} else { } else {
debugInfo.rawLaunchParams = "No PalmSystem or launchParams available";
debugInfo.finalParams = localLaunchParams;
console.log("[DEBUG] No PalmSystem or launchParams, using local params"); console.log("[DEBUG] No PalmSystem or launchParams, using local params");
// Redux dispatch가 전달된 경우 디버그 정보 저장
if (dispatch && typeof dispatch === "function") {
try {
const { setDeepLinkDebug } = require("../actions/commonActions");
dispatch(setDeepLinkDebug(debugInfo));
} catch (importError) {
console.log("[DEBUG] Failed to dispatch debug info:", importError);
}
}
return localLaunchParams; return localLaunchParams;
} }
}; };