Commit 0f9b35cc authored by Akshet Pandey's avatar Akshet Pandey

Add fallback when webview is not installed

parent 4abbe2b4
......@@ -170,7 +170,11 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {
constants.put("systemManufacturer", Build.MANUFACTURER);
constants.put("bundleId", packageName);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
constants.put("userAgent", WebSettings.getDefaultUserAgent(this.reactContext));
try {
constants.put("userAgent", WebSettings.getDefaultUserAgent(this.reactContext));
} catch (PackageManager.NameNotFoundException e) {
constants.put("userAgent", System.getProperty("http.agent"));
}
}
constants.put("timezone", TimeZone.getDefault().getID());
constants.put("isEmulator", this.isEmulator());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment