React Native

The Scrimmage Rewards Widget can be integrated into your React Native application using a WebView.

  1. Import the WebView component:

    import { WebView } from 'react-native-webview';
    
  2. Create a reference to the WebView component:

    const scrimmageWebView = useRef(null);
    
  3. Add the WebView component to your view:

    <WebView
      ref={scrimmageWebView}
      source={{ uri: `${url}?token=${token}` }}
      style={{
        flex: 1,
        backgroundColor: 'transparent',
      }}
      cacheMode="LOAD_NO_CACHE"
      onContentProcessDidTerminate={() => {
        webViewRef.current?.reload();
      }}
    />
    
    • Set url to https://<your org id>.apps.scrimmage.co.
    • Set token to the user token. Check out the Getting Started page for more information.
    • All configuration options can be found here.