@@ -147,8 +147,15 @@ let localLaunchParams = {
|
||||
// contentTarget: "V3_2001_HOMEBANNER:1240712_TM_10",
|
||||
};
|
||||
|
||||
export const getLaunchParams = () => {
|
||||
export const getLaunchParams = (dispatch = null) => {
|
||||
let params = {};
|
||||
let debugInfo = {
|
||||
rawLaunchParams: "",
|
||||
parsedParams: null,
|
||||
finalParams: null,
|
||||
containerLaunch: false,
|
||||
parseError: null,
|
||||
};
|
||||
|
||||
if (
|
||||
typeof window === "object" &&
|
||||
@@ -156,13 +163,16 @@ export const getLaunchParams = () => {
|
||||
window.PalmSystem.launchParams
|
||||
) {
|
||||
try {
|
||||
debugInfo.rawLaunchParams = window.PalmSystem.launchParams;
|
||||
console.log("[DEBUG] Raw launchParams:", 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));
|
||||
|
||||
if (params["x-webos-app-container-launch"] === true) {
|
||||
debugInfo.containerLaunch = true;
|
||||
console.log(
|
||||
"[DEBUG] Container launch detected, extracting details:",
|
||||
params.details
|
||||
@@ -170,14 +180,41 @@ export const getLaunchParams = () => {
|
||||
params = params.details || {};
|
||||
}
|
||||
|
||||
debugInfo.finalParams = JSON.parse(JSON.stringify(params));
|
||||
console.log("[DEBUG] Final params:", JSON.stringify(params, null, 2));
|
||||
} catch (e) {
|
||||
console.log("[DEBUG] LaunchParams parsing error:", e);
|
||||
debugInfo.parseError = e.message;
|
||||
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;
|
||||
} else {
|
||||
debugInfo.rawLaunchParams = "No PalmSystem or launchParams available";
|
||||
debugInfo.finalParams = localLaunchParams;
|
||||
|
||||
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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user