Commit Graph

23 Commits

Author SHA1 Message Date
Mats Byrkeland edb6ca72fd Fix ESLint warnings using 'yarn lint --fix'
Summary:
Hi! I would like to contribute to React Native, and I am just starting out. I forked the repo and found that it has quite a lot of ESLint warnings – many of which were automatically fixable. This PR is simply the result of running `yarn lint --fix` from the root folder.

Most changes are removing trailing spaces from comments.

Haven't really done any manual testing, since I haven't done any code changes manually. `yarn test` runs fine, `yarn flow` runs fine, `yarn prettier` is satisfied.

N/A

[INTERNAL][MINOR][] - Fix ESLint warnings
Closes https://github.com/facebook/react-native/pull/18047

Differential Revision: D7054948

Pulled By: hramos

fbshipit-source-id: d53e692698d1687de5821c3fb5cdb76a5e03b71e
2018-02-22 07:23:17 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
Héctor Ramos 28d60b68ad Trim docs that are already present in the open source docs site
Summary:
A lot of these docs are already present in https://github.com/facebook/react-native-website.
Closes https://github.com/facebook/react-native/pull/17776

Differential Revision: D6839783

Pulled By: hramos

fbshipit-source-id: 945fde22afb8f181d0463617d224d3f3429faa24
2018-01-29 16:20:15 -08:00
Jiajie Zhu b7216f3e18 fix flow warning and typo
Differential Revision: D5796855

fbshipit-source-id: 455c2539b111e8e7aca44d762cefabf764171beb
2017-09-08 14:46:14 -07:00
Joey Baker d53d121956 Docs: fix typo in deeplinking docs
Summary:
Just a small typo in the docs, the suggested code uses a variable that doesn't exist and leads to a compile error.
Closes https://github.com/facebook/react-native/pull/15196

Differential Revision: D5490031

Pulled By: javache

fbshipit-source-id: cb1e15b22f0d8f282afb3943fb4f5d0dc5dad9e7
2017-07-26 07:18:44 -07:00
Jason Noah Choi ff78a8de22 Add newly recommended method for RCTLinkingManager due to deprecation
Summary:
What existing problem does the pull request solve?

Beginning in iOS9, Apple has deprecated `-application:openURL:sourceApplication:annotations:`

`- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(nullable NSString *)sourceApplication annotation:(id)annotation NS_DEPRECATED_IOS(4_2, 9_0, "Please use application:openURL:options:") __TVOS_PROHIBITED;`

This PR uses the newly recommended method:

`- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)`

while meanwhile, leaving the deprecated one for developers wishing to use the older `-application:openURL:sourceApplication:annotations:` for apps that support versions 8.x or less.

Benefits will include:
- [x] less warnings
- [x] official deprecation should happen when iOS 11 is deployed
- [x] TVOS support
Closes https://github.com/facebook/react-native/pull/13615

Differential Revision: D4987980

Pulled By: javache

fbshipit-source-id: ae07715a55ca627860262a9c8cf7df1e3c5e752b
2017-05-25 11:31:23 -07:00
Johan af949877e6 updated docs with iOS 10 compatible linking code
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

The current code for IOS contains deprecated code for incoming urls.
in iOS 10 deprecated openURL.
more details here: https://useyourloaf.com/blog/openurl-deprecated-in-ios10/

1. Create an RN app with iOS 10. set up linking as per instructions.

2. Using the iOS9 code snippet, with the app is open, navigate to the apps url scheme (in safari)  appname://value1/value2, the eventListener will not trigger.  note: it will however trigger getInitialURL if app is closed.

3. Replace the old iOS9 code with the iOS 10 and trigger an incoming url from a browser appname://
with the new code in the doc it will trigger for both open and closed apps.
Closes https://github.com/facebook/react-native/pull/13942

Differential Revision: D5071851

Pulled By: hramos

fbshipit-source-id: 8394de73014a1d2a5982b22b1b6fd09e0cf524dd
2017-05-16 18:02:14 -07:00
Garrett McCullough 8da9b04bb6 update docs for Linking.openURL
Summary:
What existing problem does the pull request solve?

I was seeing errors in the crash monitoring software for my app in production.  Many took the form of, `Unable to open URL: telprompt:5551231234`

After some research, I found that when the user attempts to call a phone number, a dialog pops up in iOS asking the user to confirm or cancel the call.  If the call is canceled, the promise returned by `openURL` is rejected.

This PR improves the documentation around what happens to the promise returned by `openURL`.

No test plan, text changes only.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/13624

Differential Revision: D4962161

Pulled By: javache

fbshipit-source-id: c8d5ffbc24ba4c14c85db6ea799a6f95339b94c8
2017-04-28 04:04:14 -07:00
Adam Perry 0c9b41f2c0 Include Create React Native App in Getting Started
Summary:
cc hramos

Create React Native App was designed to reduce "time to hello world" to 5-10 minutes for React Native apps. This PR would make CRNA the first way to get started that new users encounter. Included also is some text to help advanced users navigate the question of whether to use CRNA or whether to go straight to `react-native init`. It also includes a new banner for the iOS and Android guides, since they do not apply to CRNA users.

Changes are only to the website, screenshots below. This branch was created from the last CI-passing master commit this morning, dependencies were freshly installed and these screenshots are from a clean build.

[The Getting Started page](https://www.dropbox.com/s/1s7f3wu3oxr6gpo/Screenshot%202017-04-04%2015.12.29.png?dl=0)

[The "native builds only" banner](https://www.dropbox.com/s/nyv51xdiibdkn57/Screenshot%202017-04-04%2015.13.25.png?dl=0)

[Pages which still apply to CRNApps have no banner](https://www.dropbox.com/s/qgl0h6uzynqkmy2/Screenshot%202017-04-04%2015.14.10.png?dl=0)

<details>

* [x] Decide how to handle native code & react-native-cli references outside of the `banner: ejected` guides
  * [x] [Debugging: Accessing Console Logs](https://facebook.github.io/react-native/docs/debugging.html#accessing-console-logs) isn't needed in CRNA (logs are forwarded alongside packager output)
  * [x] [Debugging: With Stetho](https://facebook.github.io/react-native/docs/debugging.html#debugging-with-stetho-http-facebook-github-io-stetho-on-android) requires native code
  * [x] [Debugging: Debugging Native Code](https://facebook.github.io/react-native/docs/debugging.html#debugging-native-code) is native-only
  * [x] [AppRegistry](https://facebook.github.io/react-native/docs/appregistry.html) only applies to ejected apps, since this is generated from code, I don't think we can set `banner: ejected`?
  * [x] [Linking](https://facebook.github.io/react-native/docs/linking.html) involves changing Android manifests and other native-side things
  * [x] [PermissionsAndroid](https://facebook.github.io/react-native/docs/permissionsandroid.html) may be flaky in the Expo client, I can't recall (cc jesseruder)
  * [x] [PushNotificationIOS](https://facebook.github.io/react-native/docs/pushnotificationios.html) won't work inside Expo, as it has to [handle its own push notifs](https://docs.expo.io/versions/v15.0.0/guides/push-notifications.html)
  * [x] [Geolocation](https://facebook.github.io/react-native/docs/geolocation.html) requires a polyfill that will most likely ship with next week's release, but that won't have any manifest changes necessary
* [ ] Figure out a strategy to handle the fact that CRNA will lag stable RN releases by ~1 week
* [x] Confirm linking out to CRNA docs is an OK strategy as opposed to moving ejecting, etc. docs in-tree
* [ ] Answer questions (I'll add some review comments to call out a few things)

</details>
Closes https://github.com/facebook/react-native/pull/13303

Differential Revision: D4950661

Pulled By: hramos

fbshipit-source-id: 3dd43828f38ca6ede3f2b0683608c56420dc6525
2017-04-26 07:16:18 -07:00
Andy Trevorah 01d4a1c6f4 fixed typo in "linking" docs
Summary:
Fixing a typo found via https://facebook.github.io/react-native/docs/linking.html

n/a (they're docs)
Closes https://github.com/facebook/react-native/pull/13440

Differential Revision: D4875315

Pulled By: javache

fbshipit-source-id: 919cf263dba5fb3e8eda6b5181b7b88e1698ef6f
2017-04-12 16:31:35 -07:00
Viktor Seč ec68c97d72 Add iOS Linking location example to docs
Summary:
Hi, the docs make it seem like `geo:${latitude},${longitude}` is the cross-platform way to link locations on Google/Apple Maps. This is Android-only though.

I did no changes to code.

I noticed that the Appetize.io embed tries to run the [Linking example](https://facebook.github.io/react-native/docs/linking.html) code on iOS, although the example uses Android location scheme. This results in errors. I'd like to fix this as well, but I have no idea how to tell the demo to run on Android.
Closes https://github.com/facebook/react-native/pull/13220

Differential Revision: D4804123

Pulled By: hramos

fbshipit-source-id: 2de85d56476933ec54ea423d76a0fe98ed5132d3
2017-03-31 10:46:55 -07:00
Jeremi Stadler c41b29d6de Fixes missleading comment on getInitialURL
Summary:
The returned value from Linking.getInitialURL is a promise that returns an url.

Can be seen here: f126540519/Libraries/Linking/Linking.js (L175)
Closes https://github.com/facebook/react-native/pull/12851

Differential Revision: D4716084

Pulled By: hramos

fbshipit-source-id: 309881cfb423a5c9a3f9010ae7ca226b63c91599
2017-03-21 16:34:42 -07:00
Vedad Sose f126540519 Fix linking manager library name in documentation
Summary:
I had an issue while using

```#import "RCTLinkingManager.h"```

![image](https://cloud.githubusercontent.com/assets/1089932/22933908/523cf910-f2cd-11e6-9c20-b3c298d5b7cc.png)

But when replaced with

```#import <React/RCTLinkingManager.h>```

the build succeeds.

Looks fine on the website:

![image](https://cloud.githubusercontent.com/assets/1089932/22934563/b1ff337a-f2cf-11e6-9109-b133aef1d69c.png)
Closes https://github.com/facebook/react-native/pull/12383

Differential Revision: D4658153

Pulled By: ericvicenti

fbshipit-source-id: e48368c08cb27bf68ea2f1294129669896350f34
2017-03-06 00:45:25 -08:00
David Aurelio 94666f16c7 Auto-fix lint errors
Reviewed By: bestander

Differential Revision: D3683952

fbshipit-source-id: 9484d0b0e86859e8edaca0da1aa13a667f200905
2016-08-09 06:43:46 -07:00
Ricky Reusser c36430a0d6 Hook up Android intent to Linking.js #7079
Summary:
Fixed #7118 by rreusser
Closes https://github.com/facebook/react-native/pull/7940

Differential Revision: D3391586

fbshipit-source-id: f7e572a91347fb0629602374cb6944eabf5b0e8f
2016-06-05 18:58:24 -07:00
Basil Hosmer fe5c2615dd react-native-github: turn on strict type args in Flow, codemod stragglers
Reviewed By: frantic

Differential Revision: D3374980

fbshipit-source-id: 6dbefeffa588f676c8e162ba7ac7912b61a7711a
2016-06-03 02:43:57 -07:00
Jim Remsik a49558def8 Documentation typo – missing word
Summary:
Adds a word to enhance readability.
Closes https://github.com/facebook/react-native/pull/7867

Differential Revision: D3370881

Pulled By: nicklockwood

fbshipit-source-id: e3555a859dd3a44f2b9d12a22d1a2366a6a8097f
2016-06-01 00:58:29 -07:00
Nick Lockwood 1623e34c51 Updated Linking and PushNotificationIOS modules to use NativeEventEmitter
Reviewed By: javache

Differential Revision: D3352819

fbshipit-source-id: d218791a16aba597d2544691ef993711cf00522c
2016-05-27 10:28:23 -07:00
Mike Grabowski 9d7b537dd4 Mention native code in `Linking` docs
Summary:Fixes #5925
Closes https://github.com/facebook/react-native/pull/7101

Differential Revision: D3206134

fb-gh-sync-id: e65ae97c32685d6acc08be2019dd2da902e01bc9
fbshipit-source-id: e65ae97c32685d6acc08be2019dd2da902e01bc9
2016-04-20 19:23:19 -07:00
David Aurelio ad8a335864 Remove knowledge of fbjs from the packager
Summary:Follow-up to https://github.com/facebook/react-native/pull/5084

This…
- changes all requires within RN to `require('fbjs/lib/…')`
- updates `.flowconfig`
- updates `packager/blacklist.js`
- adapts tests
- removes things from `Libraries/vendor/{core,emitter}` that are also in fbjs
- removes knowledge of `fbjs` from the packager

Closes https://github.com/facebook/react-native/pull/5084

Reviewed By: bestander

Differential Revision: D2926835

fb-gh-sync-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
shipit-source-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
2016-03-02 04:28:38 -08:00
Ali Najafizadeh e6a39a1d18 Update Linking.js
Reviewed By: svcscm

Differential Revision: D2933128

fb-gh-sync-id: ef33f88db50d6ddb7dd208b7ba5dab41c1ee2f81
shipit-source-id: ef33f88db50d6ddb7dd208b7ba5dab41c1ee2f81
2016-02-12 12:58:31 -08:00
Michael Anderson 197880518b Updating the native code to make it match reality.
Summary:
In the native code, you must use RCTLinkingManager instead of LinkingManager and you have to import it as well.
Closes https://github.com/facebook/react-native/pull/5830

Reviewed By: svcscm

Differential Revision: D2921718

Pulled By: androidtrunkagent

fb-gh-sync-id: a95ec358c69e8830b7f0fb2ec60baefc06139758
shipit-source-id: a95ec358c69e8830b7f0fb2ec60baefc06139758
2016-02-10 08:39:35 -08:00
Satyajit Sahoo e33e6ab1f0 Add cross-platform Linking module
Summary:
A promise based API for handling Link for Android and iOS. Refer #4971

The iOS part doesn't handle errors. Will need someone with iOS knowledge to do that.

cc skevy ide brentvatne mkonicek vjeux nicklockwood
Closes https://github.com/facebook/react-native/pull/5336

Reviewed By: svcscm

Differential Revision: D2866664

Pulled By: androidtrunkagent

fb-gh-sync-id: 67e68a827e6b85886bfa84e79b897f079e78b1b5
2016-01-26 14:34:31 -08:00