Skip to content

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

@robertjcolley

Description

@robertjcolley

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    TriageddependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    Status

    Tell Us What You Need

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions