If you want to extract query parameters from the URL in your app, you can utilize the loadFinishedEvent
by registering it and then checking for the specific URL that contains the desired parameters. This approach is particularly useful for scenarios like handling third party logins.
handleWebViewLoad(args) {
const webview: WebView = <WebView>args.object;
webview.on(WebView.loadFinishedEvent, (webargs: LoadEventData) => {
let message;
if (!webargs.error) {
if (webargs.url.toLowerCase().indexOf('spotity') > -1) {
// Extract and process query parameters here
}
message = 'WebView finished loading of ' + webargs.url;
} else {
message = 'Error loading ' + webargs.url + ': ' + webargs.error;
}
});
}