@react-native-embrace/webview-tracker
TypeScript icon, indicating that this package has built-in type declarations

0.2.12 • Public • Published

React Native Embrace - WebView Tracker

Core Module Required

This module requires React Native Embrace SDK.

Add WebView Tracker

Adding Context to Sessions

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.

Adding the component

Embrace has a separate module for tracking WebView, to use it you will need to add the WebView Tracker

Install the component

yarn add @react-native-embrace/webview-tracker
npm install @react-native-embrace/webview-tracker

Adding the method to your code

Add the logEmbraceWebView to your WebView component

// Import the Embrace log method
import { logEmbraceWebView } from "@react-native-embrace/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" }}
    />
  );
};

Readme

Keywords

none

Package Sidebar

Install

npm i @react-native-embrace/webview-tracker

Homepage

embrace.io/

Weekly Downloads

0

Version

0.2.12

License

ISC

Unpacked Size

6.07 kB

Total Files

7

Last publish

Collaborators

  • fnewberg
  • themutsi