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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile/iOS: Prevent RNDeviceInfo from creating a UIWebView #873

merged 1 commit into from Jan 3, 2019


None yet
2 participants
Copy link

commented Jan 2, 2019


react-native-device-info uses a UIWebView to get the user agent of the device during app launch (via constantsToExport). This blocks the main queue at startup. Additionally, UIWebView is known to have performance and memory issues and was deprecated in iOS 8. Since we don't use the user agent, this is unnecessary. This PR patches RNDeviceInfo.m to prevent it from creating a UIWebView.

In Release mode, this decreases memory usage by 10-20 MB and decreases app startup time by ~1.2 seconds 馃帀

Type of change

  • Bug fix (a non-breaking change which fixes an issue)

How Has This Been Tested?

  • Profiled memory usage in Instruments
  • Ran on iOS simulator


  • My code follows the style guidelines for this project
  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes
  • For changes to mobile that include native code (including React Native modules): I have verified that both iOS and Android successfully build in both Debug and Release modes

@rajivshah3 rajivshah3 merged commit 252a1ed into develop Jan 3, 2019

9 checks passed

buildkite/trinity-desktop-prs Build #1668 passed (3 minutes, 58 seconds)
buildkite/trinity-mobile-prs Build #1703 passed (4 minutes, 27 seconds)
buildkite/trinity-shared-prs Build #690 passed (3 minutes, 15 seconds)
ci/bitrise/e1c71066b5c75521/pr Passed - trinity-mobile
security/snyk - package.json (IOTA Foundation) No new issues
security/snyk - src/desktop/package.json (IOTA Foundation) No new issues
security/snyk - src/mobile/android/app/build.gradle (IOTA Foundation) No manifest changes detected
security/snyk - src/mobile/package.json (IOTA Foundation) No new issues
security/snyk - src/shared/package.json (IOTA Foundation) No new issues

@rajivshah3 rajivshah3 deleted the fix/no-webview branch Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.