I have below function to return some data to JS side and It’s a Map
(However the flutter_inappwebview
encodes the map after I return It), I do this by addJavaScriptHandler
of flutter_inappwebview
, But when I return the data I expect the returned object’s readValue property is a function
but It’s not and in JS side the property type is string
and I have to use eval
of JS to convert this property to function
and then use It.
return {
// Other properties
'readValue': '''(async function() {
var response = await window.myyApp.callHandler('eventName', { 'this': '$uuid' });
return response;
})
''',
};
}
I am looking for a way to return function
in the first place.