navigateToPage
Relevant to all supported platforms.
Description
An action event. When the user clicks on a navigation button within the Personetics widget, the navigateToPage function in the eventDelegate object will be invoked. The widget will pass the context required for the navigation action, to the navigateToPage function. The navigate target key can be mapped to one of the following:
- manage-budgets – requires opening a new manage-budgets widgets
- subscriptions – requires opening a new subscription-widget
- subscriptionView – requires opening a new subscription-widget
- Open banking widgets - supported only for web layout:
- obOnboarding – requires opening a new open banking onboarding widget
- obManagement - requires opening a new open banking management widget
Return value - None
Example of navigateToPage for web layout:
this.navigateToPage = function (params) {
Personetics.log("Customer : navigateToPage, Params : " + JSON.stringify(params));
const { widgetSelector, data: { navigateTarget, isActiveWidget } = {} } = params;
const appConfig = window.personetics.config[widgetSelector];
const channel = personetics.withWidget({ widgetSelector }, () => personetics.getDeviceType());
switch (channel) {
case "web": {
const navigateTargetToWidgetTypeMapping = {
manageBudget: "manage-budgets",
subscriptions: "subscription-dashboard",
recap: "recap",
actOnboarding: "actOnboarding",
actManagement: "actManagement",
obOnboarding: "obOnboarding",
obManagement: "obManagement",
};
if (Object.prototype.hasOwnProperty.call(navigateTargetToWidgetTypeMapping, navigateTarget) || isActiveWidget) {
const widgetType = isActiveWidget ? "activeWidget" : navigateTargetToWidgetTypeMapping[navigateTarget];
const startWidgetConfig = $.extend(true, appConfig, {
configurations: {
widgetType,
params: {
userId: params.userId,
insightId: params.insightId,
instanceId: params.instanceId,
useCaseId: params.useCaseId,
params: params.data.payload,
navigateTarget,
},
},
internationalization: {
language: params.lang,
},
});
if (this.isPayload === "true") {
// note that the getInsightDetails was declared in predefinedData.js
startWidgetConfig.configurations.params.payload = {
GET_BUDGETS_CATEGORIES: window.getBudgetsCategories,
};
}
// Customer will implement his own widgets call stack.
personetics.widgetsCallStack[widgetSelector] = personetics.widgetsCallStack[widgetSelector] ?? [];
personetics.widgetsCallStack[widgetSelector].push(appConfig.widgetType);
personetics.startWidget(startWidgetConfig);
}
break;
}
default: {
this.sendRequestToPServer(null, params);
break;
}
}
};
Web Layout Params
These Parameters are relevant for the following layouts:
- Web Vanilla JS
- Web React JS
- Web Angular JS
Name | Type | Mandatory | Description |
---|---|---|---|
params_map | Map | Yes | Additional information to be accompanied with navigation - e.g: {navigateTarget: link_ID} |
manageBudget | String | Optional | Navigate to the budget widget |
subscriptions | String | Optional | Navigate to subscriptions widget |
recap | String | Optional | Navigate to Recap Widget |
actOnboarding | String | Optional | Navigate to ACT onboarding widget |
actManagement | String | Optional | Navigate to ACT management widget |
obManagement | String | Optional | Navigate to open banking onboarding widget |
obOnboarding | String | Optional | Navigate to open banking management widget |
Mobile Layout Params
iOS Swift, Android, React Native
Name | Type | Mandatory | Description |
---|---|---|---|
params_map | Map | Yes | Additional information to be accompanied with navigation - e.g: {navigateTarget: link_ID} |
manageBudget | String | Optional | Navigate to the budget widget |
subscriptions | String | Optional | Navigate to subscriptions widget |
recap | String | Optoinal | Navigate to Recap Widget |
actOnboarding | String | Optional | Navigate to onboarding widget |
actManagement | String | Optional | Navigate to management widget |
Flutter Parameters
Name | Type | Mandatory | Description |
---|---|---|---|
context | BuildContext | Yes | The build context of the webView widget. |
requestBodyParams | Map<String, dynamic> | Yes | Request body to be sent to Personetics server |
Updated 6 months ago