Skip to content

Latest commit

 

History

History

webview-tracker

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

React Native Embrace - WebView Tracker

Important

This module requires React Native Embrace SDK.

Embrace can collect basic session data and crashes as you've already seen in the Crash Reporting and Session Reporting sections. Embrace can also collect the data from your web page inside a Webview component Here's how you add the WebView tracker to the session.

Install the component

yarn add @embrace-io/webview-tracker

Or

npm i @embrace-io/webview-tracker

Adding the method to your code

Add the logEmbraceWebView to your WebView component

// Import the Embrace log method
import { logEmbraceWebView } from "@embrace-io/webview-tracker";
import { WebView } from "react-native-webview";

const App = () => {
  const handleOnMessage = (message) => {
    logEmbraceWebView("MyCheckout", message);
  };
  return (
    <WebView
      useWebKit
      onMessage={handleOnMessage}
      source={{ uri: "URL TO TRACK" }}
    />
  );
};