Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS Chime SDK Doesn't work with React Native #1856

Closed
4 tasks done
robertjcolley opened this issue Dec 7, 2021 · 4 comments
Closed
4 tasks done

AWS Chime SDK Doesn't work with React Native #1856

robertjcolley opened this issue Dec 7, 2021 · 4 comments
Labels
dependencies Pull requests that update a dependency file Triaged

Comments

@robertjcolley
Copy link

robertjcolley commented Dec 7, 2021

What happened and what did you expect to happen?

React Native supports websockets and can handle it. I expected messaging to work, but I got an error

Error: null is not an object (evaluating 'this.version().split()')

I ended up tracing it to the detect-browser React Native implementation here:

https://github.com/DamonOehlman/detect-browser/blob/546e6f1348375d8a486f21da07b20717267f6c49/src/index.ts#L59-L65

which is referenced in

https://github.com/aws/amazon-chime-sdk-js/blob/8af993e501fbf0c18b0b567e5e5a20114f08abd2/src/browserbehavior/DefaultBrowserBehavior.ts

The solution is:

  1. detect-browser needs to update their implementation of React Native. I've made a PR to their project (HERE)
  2. aws-chime-sdk-js needs to update detect-browser when this PR is merged in and detect-browser is updated

I've been able to successfully create a patch which I can use patch-package to run in a post install script for the time being (see attached) and confirmed that this patch did correctly fix the issue and I was successfully able to use the SDK. I'm creating this issue here to track this issue until it is resolved, and will update this as I fix issues in detect-browser.

I had to rename the ".patch" file to ".patch.txt" to upload to GitHub:

detect-browser+5.3.0.patch.txt

Have you reviewed our existing documentation?

Reproduction steps

Try creating a DefaultMessagingSession in React Native

Amazon Chime SDK for JavaScript version

latest

What browsers are you seeing the problem on?

React Native

Browser version

0.65.1

Meeting and Attendee ID Information.

N/A

Browser console logs

N/A - see top section

@simmkyu
Copy link
Contributor

simmkyu commented Dec 7, 2021

Thanks for creating an issue. In addition to WebSocket, Chime SDK for JavaScript uses WebRTC, MediaDevices, Web Audio, and other browser APIs that may not or partially be supported in React Native, e.g., The WebRTC module for React Native.

For React Native use cases, we have a demo application using Chime SDK for iOS and Android. Could you check out the following demo?
https://github.com/aws-samples/amazon-chime-react-native-demo

@robertjcolley
Copy link
Author

I have checked that out and have no issues with the meeting functionality provided by those SDKs! They work great 😄.

This issue came about after implementing the messaging (which is implemented in web sockets - something that react native supports). The patch file I provided was enough for this to be completely fixed.

Not an issue with this project, I just need something fixed in the detect-browser package. I made the issue here for when they get back to me with a fix, so I can recommend a dependency upgrade!

@jing-chen1
Copy link
Contributor

Hi @NS-BOBBY-C,

Thanks for your interest in Chime SDK for JavaScript! Please let us know when detect-browser fix take your fix and upgrade on NPM, then we can update our dependency to fix your problem.

@xuesichao
Copy link
Contributor

Error: null is not an object (evaluating 'this.version().split()')

We added null check in majorVersion() in #2688. This is no longer an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Triaged
Projects
Status: Tell Us What You Need
Development

No branches or pull requests

6 participants