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

React-native client info #629

Merged
merged 6 commits into from
Mar 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use navigator.product for detecting RN
davidliu committed Mar 24, 2023
commit 7324d6718b25249c4d62b8b0c15d93c59a7f9e7f
10 changes: 2 additions & 8 deletions src/room/utils.ts
Original file line number Diff line number Diff line change
@@ -123,14 +123,8 @@ export function isWeb(): boolean {
}

export function isReactNative(): boolean {
let reactNative;
try {
reactNative = require('react-native');
} catch {
return false;
}

return Boolean(reactNative);
// navigator.product is deprecated on browsers, but will be set appropriately for react-native.
return navigator.product == 'ReactNative';
}

export function getReactNativeOs(): string | undefined {