June 2018
Beginner to intermediate
394 pages
9h 2m
English
WebView-based applications still solve some unique problems. Most banking applications are hybrid and WebView-based. Before WebView sends anything to Firebase, it needs to send the native code. The following JavaScript code shows how to handle analytics on both platforms:
function logEvent(name, params) { if (!name) { return; } if (window.AnalyticsWebInterface) { // Call Android interface window.AnalyticsWebInterface.logEvent(name, JSON.stringify(params)); } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.firebase) { // Call iOS interface var message = { command: 'logEvent', name: name, parameters: params }; window.webkit.messageHandlers.firebase.postMessage(message); } else ...
Read now
Unlock full access