I have a website that is built with reactJs. I have built a mobile version not using react native but this:
import React from "react";
import { WebView } from "react-native-webview";
export default function App() {
return (
<WebView
source={{ uri: "https://mywebsiteurl" }}
style={{ marginTop: 20, backgroundColor: "transparent" }}
/>
);
}
Now I want to detect whether the app is running on a browser or mobile app from inside my web reactJS code.
N.B : I do not want to differentiate between mobile browser and web browser. I want to detect whether browser(any browser of windows/MacOS/ubuntu/IOS/android/Smart tv) or mobile app(IOS/Android)