Browse Source

Fix: use route-specific parameter keys in deep link parser

Fix iOS deep link "Invalid Deep Link" error by updating parseDeepLink
to use correct parameter keys from ROUTE_MAP instead of always using 'id'.

- Replace hardcoded 'id' parameter assignment with dynamic lookup
- Use routeConfig.paramKey for route-specific parameter names (e.g., groupId for onboard-meeting-members)
- Maintain backward compatibility with fallback to 'id' for routes without explicit paramKey
didview-invalid-did-handling
Jose Olarte III 2 days ago
parent
commit
612c0b51cc
  1. 14
      src/services/deepLinks.ts

14
src/services/deepLinks.ts

@ -130,14 +130,24 @@ export class DeepLinkHandler {
const [path, queryString] = parts[1].split("?");
const [routePath, ...pathParams] = path.split("/");
// Parse path parameters
// Parse path parameters using route-specific configuration
const params: Record<string, string> = {};
if (pathParams.length > 0) {
// Get the correct parameter key for this route
const routeConfig = ROUTE_MAP[routePath];
if (routeConfig?.paramKey) {
params[routeConfig.paramKey] = pathParams[0];
logger.debug(
`[DeepLink] 📍 Path parameter extracted: ${routeConfig.paramKey}=${pathParams[0]}`,
);
} else {
// Fallback to 'id' for backward compatibility
params.id = pathParams[0];
logger.debug(
`[DeepLink] 📍 Path parameter extracted: id=${pathParams[0]}`,
`[DeepLink] 📍 Path parameter extracted: id=${pathParams[0]} (fallback)`,
);
}
}
// Parse query parameters
const query: Record<string, string> = {};

Loading…
Cancel
Save