The OpenTok-React-Native subscriber causes the Android application to unexpectedly crash

Currently, I am in the process of integrating the OpenTok Lib into my react-native project. However, I have encountered some issues that I have not been able to resolve yet. The main issue is that when attempting to connect as a Subscriber to a session, the app crashes on android devices. This prevents me from testing the connection between two phones.

I am seeking assistance to figure out what might be causing this problem.


Appointment

import React, { Component } from 'react';
import { OTSession } from 'opentok-react-native';

import { TokBox } from '../../../helpers/constants';
import PublisherStream from './PublisherStream';
import SubscriberStream from './SubscriberStream';

class Appointment extends Component {
  static navigationOptions = {
    header: null
  };

  render() {
    const { navigation: { navigate, state: { params } } } = this.props;
    return (
      <OTSession style={{ flex: 1 }}
        apiKey={TokBox.API_KEY}
        sessionId={params.sessionId}
        token={params.token}
        eventHandlers={this.sessionEventHandlers}>
        <PublisherStream style={{ borderColor: 'red', borderWidth: 3, height: '50%' }} />
        <SubscriberStream style={{ borderColor: 'blue', borderWidth: 3, height: '50%' }} />
      </OTSession>
    );
  }
}

export default Appointment;

PublisherStream

import React, { Component } from 'react';
import { OTPublisher } from 'opentok-react-native';

class PublisherStream extends Component {
  publisherEventHandlers = {
    streamCreated: (event) => {
      console.log('Publisher stream created!', event);
    },
    streamDestroyed: (event) => {
      console.log('Publisher stream destroyed!', event);
    }
  };


  render() {
    return (
      <OTPublisher style={this.props.style} eventHandlers={this.publisherEventHandlers} />
    );
  }
}

export default PublisherStream;

SubscriberStream

import React, { Component } from 'react';
import { OTSubscriber } from 'opentok-react-native';

class SubscriberStream extends Component {
  subscriberProperties = {
    subscribeToAudio: true,
    subscribeToVideo: true,
  };

  subscriberEventHandler = {
    connected(event) {
      console.log('connected', event);
    },
    disconnected(event) {
      console.log('disconnected', event);
    },
    videoDataReceived(event) {
      console.log('videoDataReceived', event);
    },
    videoEnabled(event) {
      console.log('videoEnabled', event);
    },
    videoNetworkStats(event) {
      console.log('videoNetworkStats', event);
    }
  };

  render() {
    return (
      <OTSubscriber
        properties={this.subscriberProperties}
        eventHandlers={this.subscriberEventHandler}
        style={this.props.style}
      />
    );
  }
}

export default SubscriberStream;

Package.json

{
  {...omitted}
  "dependencies": {
    "opentok-react-native": "^0.9.5",
    "react": "^16.8.1",
    "react-native": "0.58.4",
  },
  {...omitted}
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The search and pagination features of Bootstrap dataTable do not function properly when the data is being retrieved from an AJAX API response

Currently, I am in the process of developing an admin panel. While I have successfully loaded data from an Ajax API response into a bootstrap dataTable, I have encountered issues with the default search and pagination functionalities of the table. "proces ...

Utilizing the Power of Mui Datatable to Enhance User Experience with Repeatable Edit and Delete

Hey Everyone, I'm currently trying to implement edit and delete buttons in ReactJS using Mui Datatable. However, I am facing a recurring issue due to the Map function since I am relatively new to ReactJS. Below is my image and code snippet: Here is a ...

Modifying several classes across different elements within a Svelte component

I developed a simple quiz application in which the user selects an answer and then clicks the 'check' button. If the selected answer is correct, it will be highlighted in green while incorrect answers are highlighted in red. Conversely, if the wr ...

Encountering Uncaught Syntax Error when attempting a request with JSON parameters

Currently, I am using Fetch to send a post request to my server while including some additional information. Here's the code snippet: var rating = document.getElementById("rating"); var ratingValue = rating.innerHTML; fetch("/films",{ method: "po ...

Google Chrome does not support inlined sources when it comes to source maps

Greetings to all who venture across the vast expanse of the internet! I am currently delving into the realm of typescript-code and transcending it into javascript. With the utilization of both --inlineSourceMap and --inlineSources flags, I have observed t ...

Using NodeJS to convert a Base64 string into a JPEG image with the help of either NodeJS or

I have successfully stored a JPEG image in my MySQL database using the longblob format. Now, when I retrieve the longblob data, I am only getting a base64 string. How can I convert this base64 string back to a readable JPEG image using MySQL or Node.js? B ...

Is there a way to loop an AnimationSet in Java code?

I'm currently working on creating a vibrating text effect for my app. I've set up some animations in an AnimationSet, but for some reason, I can't get it to repeat. I've tried numerous solutions from different sources without success. C ...

After making a call to the backend in React, the action function consistently returns the same reducer type

As I finalize my 2FA implementation, the last step involves detecting whether a user has enabled it or not. I've created a function that checks for this and returns the following: if (!user.twoFactorTokenEnabled) { // Allow user to login if 2FA ...

The process of transferring a PHP variable to JavaScript

I'm making a new attempt at a more specific solution here. I'm trying to retrieve the value from my <span id=”$var”>BadText</span> using a variable. Passing the idFull to the function works well when I first assign the value to a ...

The typical number of keys in a ChartJS graph is 2

Currently, I am utilizing ChartJS for a project that displays user-added records such as weight and heart rate for tracking purposes. I have encountered an issue where if a user adds two slightly different value records for the same day, it results in both ...

A Comparison of Mootools Elements in Moo Versions 1.1 and 1.2

I have a script that uses mootools 1.1 to manage an Ajax "form" and checks how many rows are in the dynamically created form before processing them: form_rows = $$('#form_row'); // The number of rows can vary from 4 to 20 console.log(form_rows.l ...

find the text that is not encompassed by a particular html tag

After coming across this inquiry, I am curious about how one can detect text that is not within a particular HTML tag. desired text: "targetstring" excluding the script HTML tag <div> <h1>targetstring</h1> <= should be detected ...

What is the best way to dynamically fill the content of a second input field when a selection in a dropdown menu triggers an onchange event?

Looking for a way to duplicate the value of a select input into a second input field using Javascript. Attempted to achieve this with an onchange event call, but encountering difficulties. What is the proper JavaScript code to populate the input field with ...

Unresolved issue with Three.js FBX model animation freezing on initial frame

I have a character FBX model and downloaded a walking animation from Mixamo, but without the skin. This is how I am loading the character and animation: const loader = new THREE.FBXLoader(); let mixer; loader.load( 'Assets/T-Pose.fbx', function ( ...

Generate table rows by automatically summing the rows and column data using a loop

I'm currently working on a form that dynamically adds data to columns and rows. While I've successfully generated the column names based on database data and used a loop to add details, adding rows has proved to be quite challenging :) Is ther ...

The android camera app encountered a java.lang.RuntimeException when trying to instantiate the activity ComponentInfo

Trying to create a custom Android app using the Android Developer site and Android Studio, but encountering errors when running the app in the emulator. The error message received is: java.lang.RuntimeException: Unable to instantiate activity ComponentInf ...

Issue with resetting the form field

Whenever a user opens a modal window to save data, I reset the form fields to blank. This works as expected, but I encountered an issue with AngularJS form validation messages appearing due to dirty check. I tried adding $setPristine() to resolve this, but ...

What is the best method for submitting an array of objects using Axios, Formik, and React.js?

Hello, I am facing an issue with posting an array of objects using axios and Formik while also utilizing npm react-select. Here is my initial data: const [initialValues, setInitialValues] = useState( { nom: "",drugs: [{}] ...

The code is slicing data, but the changes are not reflecting in the user interface

Initially, there are three drop down menus displayed. Upon selecting an option from the first drop down menu, the values in the second drop down menu load. After selecting an option from the second drop down menu, a new set of drop downs appears. However, ...

Retrieve all items from the firebase database

I have a query. Can we fetch all items from a particular node using a Firebase cloud function with an HTTP Trigger? Essentially, calling this function would retrieve all objects, similar to a "GET All" operation. My next question is: I am aware of the onW ...