A framework for building native macOS apps with React.
Перейти к файлу
Estevão Lucas fa426cf05f - Add openSettings method to Linking module (#23965)
Summary:
This will create a cross-platform and safe way to programmatically open the app's settings into the iOS /Android Settings app.

Right now it's possible to open the app's settings, but _**only for iOS**_ via `Linking.openURL("app-settings:")`

To do the same for Android, you need to either create NodeModule or install a dependency such as [react-native-open-settings](https://github.com/lunarmayor/react-native-open-settings).

Why this new method is useful: since Android 6, app permissions work similar to iOS. It's granular and it's requested in the app runtime.

https://developer.android.com/guide/topics/permissions/overview#runtime_requests_android_60_and_higher

> If the device is running Android 6.0 (API level 23) or higher, and the app's targetSdkVersion is 23 or higher, the user isn't notified of any app permissions at install time. Your app must ask the user to grant the dangerous permissions at runtime. When your app requests permission, the user sees a system dialog telling the user which permission group your app is trying to access. The dialog includes a Deny and Allow button.

Thus, if the user checks the **"Never ask again box"** and taps **"Deny"**, for some specific permission, the only way to change the permission is going to the Android Setting app.

And that's where this new method becomes useful. It'll allow our apps to programmatically send the the user to  settings app.

Also, `openSettings()` doesn't receive a parameter to redirect to specific subsections of the Settings app because there's no public API to do it on iOS ([there's a way to have, via private API, but it causes the app to get rejected.](https://github.com/mauron85/cordova-plugin-background-geolocation/issues/394))

Create `Linking.openSettings()` for iOS and Android;

[General] [add ] - Add openSetting method to Linking module
Pull Request resolved: https://github.com/facebook/react-native/pull/23965

Differential Revision: D14502910

Pulled By: cpojer

fbshipit-source-id: d27d62282b9df499845c78d983d3b6936c36ea39
2019-03-18 08:06:12 -07:00
.appveyor add yml to prettier list.Fixes #23426 (#23953) 2019-03-15 08:10:02 -07:00
.circleci Update React Native to use latest CLI (#23940) 2019-03-18 06:22:53 -07:00
.github Use Backlog label to keep issues open (#23789) 2019-03-12 15:16:52 -07:00
IntegrationTests Bump Prettier to 1.16.4 2019-03-14 07:00:27 -07:00
Libraries - Add openSettings method to Linking module (#23965) 2019-03-18 08:06:12 -07:00
RNTester Update React Native to use latest CLI (#23940) 2019-03-18 06:22:53 -07:00
React Fabric: working podspecs & works in RNTester (#23803) 2019-03-15 23:59:22 -07:00
ReactAndroid - Add openSettings method to Linking module (#23965) 2019-03-18 08:06:12 -07:00
ReactCommon Upgrade mobile BUCK and .bzl files to use C++14 2019-03-16 02:25:33 -07:00
bots Add SUPPORT document, update other GitHub templates (#23778) 2019-03-05 17:08:24 -08:00
flow Replace our local types by flow-typed (#20320) 2018-12-20 04:42:34 -08:00
flow-typed/npm remove deprecated utilities 2019-01-15 13:59:31 -08:00
gradle/wrapper bump gradle to 5.0, android gradle plugin to 3.3.1 (#23324) 2019-02-20 11:42:54 -08:00
jest - Add openSettings method to Linking module (#23965) 2019-03-18 08:06:12 -07:00
keystores Use fb_native_wrapper for all targets 2018-10-31 11:47:42 -07:00
lib Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
local-cli Update references to the CLI (#23052) 2019-01-21 09:13:08 -08:00
packages Update React Native to use latest CLI (#23940) 2019-03-18 06:22:53 -07:00
scripts Fix and update end to end tests for Android (#23958) 2019-03-18 07:51:01 -07:00
template flow v0.95 2019-03-16 09:12:27 -07:00
third-party-podspecs Fabric: working podspecs & works in RNTester (#23803) 2019-03-15 23:59:22 -07:00
tools/build_defs Migration of RN-Android OSS tests to Android X 2019-03-17 08:13:30 -07:00
.buckconfig Bump Android SDK to 28, Build Tools to 28.0.2, Gradle to 4.7, Gradle Plugin to 3.2.0 (#21632) 2018-12-05 09:06:31 -08:00
.buckjavaargs
.clang-format Moving ObjC specific clang-format rules to the common config 2019-02-11 13:07:09 -08:00
.editorconfig editorconfig: Set indent_size for BUCK files to 4 (#21554) 2018-10-08 23:17:38 -07:00
.eslintignore Suggest running yarn lint --fix (#23413) 2019-02-13 08:46:03 -08:00
.eslintrc Rename eslint config to 'eslint-config-react-native-community' (#23718) 2019-03-03 20:39:43 -08:00
.flowconfig flow v0.95 2019-03-16 09:12:27 -07:00
.flowconfig.android flow v0.95 2019-03-16 09:12:27 -07:00
.gitattributes
.gitignore Check Flow and run basic packager tests using open source RN config 2018-08-09 16:17:40 -07:00
.nvmrc
CODE_OF_CONDUCT.md Update repo documentation to match other Facebook projects 2018-09-10 18:02:26 -07:00
CONTRIBUTING.md Update repo documentation to match other Facebook projects 2018-09-10 18:02:26 -07:00
LICENSE Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
LICENSE-docs
README.md Fix broken links in table of contents Readme (#23795) 2019-03-06 17:13:35 -08:00
React.podspec Split React.podspec into separate podspecs for each Xcode project (#23559) 2019-02-21 18:35:44 -08:00
Releases.md Fix typo in Releases.md (#20487) 2018-08-01 07:16:56 -07:00
build.gradle bump Gradle Android Plugin to 3.3.2 (#23854) 2019-03-13 09:45:54 -07:00
cli.js Update references to the CLI (#23052) 2019-01-21 09:13:08 -08:00
gradlew fix gradle wrapper issue (#19976) 2018-08-08 15:03:01 -07:00
gradlew.bat Use new JavaScriptCore from npm (#22231) 2018-12-27 14:51:03 -08:00
jest-preset.js Remove react-clone-referenced-element dependency (#23933) 2019-03-15 11:50:07 -07:00
jest.config.js extract jest config from package.json (#23638) 2019-02-25 21:49:10 -08:00
package.json Update React Native to use latest CLI (#23940) 2019-03-18 06:22:53 -07:00
react.gradle Fix buildType issue introduced in rebase (#23444) 2019-02-13 19:08:27 -08:00
rn-cli.config.js Update React Native to use latest CLI (#23940) 2019-03-18 06:22:53 -07:00
rn-get-polyfills.js Remove global babelHelpers and regenerator (#21283) 2018-09-26 10:03:05 -07:00
runXcodeTests.sh Update copyright headers to yearless format 2018-09-11 15:33:07 -07:00
settings.gradle Prepare Groovy scripts for Kotlin DSL migration (#23355) 2019-02-09 10:18:07 -08:00
yarn.lock Update React Native to use latest CLI (#23940) 2019-03-18 06:22:53 -07:00

README.md

React Native

Learn once, write anywhere:
Build mobile apps with React.

React Native is released under the MIT license. Current CircleCI build status. Current Appveyor build status. Current npm package version. PRs welcome! Follow @reactnative

Getting Started · Learn the Basics · Showcase · Contribute · Community · Support

React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.

  • Declarative. React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug.
  • Component-Based. Build encapsulated components that manage their own state, then compose them to make complex UIs.
  • Developer Velocity. See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app.
  • Portability. Reuse code across iOS, Android, and other platforms.

Contents

📋 Requirements

React Native apps may target iOS 9.0 and Android 4.1 (API 16) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like Expo can be used to work around this.

🎉 Building your first React Native app

Follow the Getting Started guide. The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios:

📖 Documentation

The full documentation for React Native can be found on our website.

The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the React documentation.

The source for the React Native documentation and website is hosted on a separate repo, @facebook/react-native-website.

🚀 Upgrading

Upgrading to new versions of React Native may give you access to more APIs, views, developer tools and other goodies. See the Upgrading Guide for instructions.

React Native releases are discussed in the React Native Community, @react-native-community/react-native-releases.

👏 How to Contribute

The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving React Native.

Code of Conduct

Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read our Contributing Guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native.

Open Source Roadmap

You can learn more about our vision for React Native in the Roadmap.

Good First Issues

We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.

Discussions

Larger discussions and proposals are discussed in @react-native-community/discussions-and-proposals.

📄 License

React Native is MIT licensed, as found in the LICENSE file.

React Native documentation is Creative Commons licensed, as found in the LICENSE-docs file.