title: how to recod scorm Interactions in window.API.cmi in React Native
body: <p>I have the SCORM file and opened it using the package react-native-webview. I need to track the progress but when I injected the javascript to set the variables the catch part executed and the alert shows me <strong>TypeError: undefined is not an object (evaluating 'window.API.cmi)</strong></p>
  <pre><code>const injectTrack = () =&gt; {
  const setTrackInjection = `
      try {
          window.API.cmi.core.student_id = &quot;${user?.id ? user?.id : ''}&quot;;  
          window.API.cmi.core.student_name = &quot;${user?.firstname ? user?.firstname : ''}&quot;;
          window.API.cmi.suspend_data = '${suspend_data}';
          window.API.cmi.core.total_time = '${total_time}';
          window.API.cmi.core.session_time = '${session_time}';
          window.API.cmi.core.score.raw = '${scoreRaw}';
          window.API.cmi.core.score.max = '${scoreMax}';
          window.API.cmi.core.score.min = '${scoreMin}';
          window.API.cmi.core.lesson_status = '${lesson_status}';
          window.API.cmi.core.exit = '${exit}';
          
      } catch(error){
          alert(error);
      }
      true;`;
  
  webviewRef.current.injectJavaScript(setTrackInjection);
  </code></pre>
  <p>};</p>