I have an app that in part, uses a webview to display an existing web application. I can pass parameters into the webview via parameters in the url. My application receives notifications from onesignal which i receive through a notification callback. That callback determines when to goto the webview scene and what parameters to pass:
function gotoMainScene(message, additionalData, isActive) local message = message or "" -- build a baseline params object local params={ base=pwaUrl, devId=osw:myDevId(), message=message or nil, isActive=isActive or nil, appVersionString = system.getInfo('appVersionString'), platformName = system.getInfo("platform"), platformVersion = system.getInfo("platformVersion"), modelName = system.getInfo("model"), archInfo = system.getInfo("architectureInfo"), } -- flatten additional data and add to params if additionalData ~= nil then for k,v in pairs(additionalData) do params[k]=v end end -- goto the webview composer.gotoScene('scene\_webview', { effect="fade", time=100, params=params, } ) end
The problem with this approach is that it reloads the webview whenever a notification occurs. Is there a way to pass parameters to the webview in the background?