Summary: Replaced all deprecated ALAssets* references to roughly equivalent PHPhoto* references in RCTCameraRoll library. There are still some minor inconsistencies between iOS/Android and documentation that existed prior to this diff that need to be resolved after this.
Reviewed By: fkgozali
Differential Revision: D13593314
fbshipit-source-id: 6d3dc43383e3ad6e3dbe73d4ceceac1ba9261d9d
Summary: Replaced all deprecated ALAssets* references to roughly equivalent PHPhoto* references in RCTCameraRoll library. There are still some minor inconsistencies between iOS/Android and documentation that existed prior to this diff that need to be resolved after this.
Reviewed By: fkgozali, PeteTheHeat
Differential Revision: D13513777
fbshipit-source-id: 3f0c4ae259823fae78eba875a6c259733715ab56
Summary: This is one more step to remove `fbjs` from `react-native-github`. This changes both the internal and external code to use `invariant` from zertosh instead of the copy in fbjs.
Reviewed By: yungsters
Differential Revision: D13195941
fbshipit-source-id: 73564ca1715110e7da9c7ef56dc57374d61377e0
Summary: Using strings to refer to Native Modules and View Managers in ReactPackages are prone to error. The compiler replaces the constants with the actual strings anyway, so using constants gives us better type safety
Reviewed By: achen1
Differential Revision: D12843649
fbshipit-source-id: 7a7c6c854c8689193f40df92dc8426a3b37f82c8
Summary: This change drops the year from the copyright headers and the LICENSE file.
Reviewed By: yungsters
Differential Revision: D9727774
fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
Summary:
@public
A few people have been complaining, including me, that when we compile a react native project, there are a lot of warnings from xcode, suggesting to update the project build settings to the new recommendations.
I took the liberty to actually update the xcode projects, so we can finally have these gone, as well as replace some deprecated methods with the new suggested ones.
[IOS] [MINOR] [Xcode] - updated the Xcode projects with the latest suggestions from Xcode 9.3, and replaced a few deprecated methods of iOS with their new replacements.
Closes https://github.com/facebook/react-native/pull/19574
Reviewed By: shergin
Differential Revision: D8530135
Pulled By: hramos
fbshipit-source-id: b9c9ede0e07760cb2207caa6b468bd5c241848dc
Summary:
AssetsLibrary.framework --> Photos.framework; ReactNative
Port RN off of AssetsLibrary where trivial, lazy load AssetsLibrary where remaining.
Reviewed By: fkgozali
Differential Revision: D7999924
fbshipit-source-id: 1d48a2d820984564459ed43680cd3f601399d352
Summary:
A few people have been complaining, including me, that when we compile a react native project, there are a lot of warnings from xcode, suggesting to update the project build settings to the new recommendations.
I took the liberty to actually update the xcode projects, so we can finally have these gone, as well as replace some deprecated methods with the new suggested ones.
I made two react native projects, one with the regular react native and the other one using this branch.
Left is before, right is after:
![screen shot 2018-06-05 at 15 44 34](https://user-images.githubusercontent.com/100233/40979899-6aba12da-68d7-11e8-8630-6c3009b6dc24.png)
[IOS] [MINOR] [Xcode] - updated the Xcode projects with the latest suggestions from Xcode 9.3, and replaced a few deprecated methods of iOS with their new replacements.
Closes https://github.com/facebook/react-native/pull/19574
Differential Revision: D8489006
Pulled By: hramos
fbshipit-source-id: 2922b2e76aca6883c4f5d04e9c511b9fc1029583
Summary:
This is to unbreak builds due to deprecated methods.
Cocoapods build seems unaffected.
Reviewed By: mmmulani
Differential Revision: D8060139
fbshipit-source-id: a4302d649dd75d29d293aeffdcc352bf09b0c504
Summary: Moving target deployment to iOS 9.0+ from now on, removing customization for iOS 8.
Reviewed By: shergin
Differential Revision: D8053439
fbshipit-source-id: 292c58f15c6e6caf8b28d15c1521812d6ed675c5
Summary:
This PR removes the need for having the `providesModule` tags in all the modules in the repository.
It configures Flow, Jest and Metro to get the module names from the filenames (`Libraries/Animated/src/nodes/AnimatedInterpolation.js` => `AnimatedInterpolation`)
* Checked the Flow configuration by running flow on the project root (no errors):
```
yarn flow
```
* Checked the Jest configuration by running the tests with a clean cache:
```
yarn jest --clearCache && yarn test
```
* Checked the Metro configuration by starting the server with a clean cache and requesting some bundles:
```
yarn run start --reset-cache
curl 'localhost:8081/IntegrationTests/AccessibilityManagerTest.bundle?platform=android'
curl 'localhost:8081/Libraries/Alert/Alert.bundle?platform=ios'
```
[INTERNAL] [FEATURE] [All] - Removed providesModule from all modules and configured tools.
Closes https://github.com/facebook/react-native/pull/18995
Reviewed By: mjesun
Differential Revision: D7729509
Pulled By: rubennorte
fbshipit-source-id: 892f760a05ce1fddb088ff0cd2e97e521fb8e825
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
Summary:
RCTCameraRollManager.m crashes when there is no filename provided for the asset (usually from iCloud). #13671
Tested on real device with iCloud library using the library without and after my fix. It worked after my changes.
[IOS] [BUGFIX] [CameraRoll] - Changed the filename if nil to be empty when the asset is coming from iCloud.
Closes https://github.com/facebook/react-native/pull/17549
Differential Revision: D6710665
Pulled By: hramos
fbshipit-source-id: 319865b0a71728798c62ee380e7bee4af584b3e3
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
There are some errors I noticed after upgrading my flow version. I had them in my project, and they were also reported in #11655. These errors were ignored on master, but I went through and fixed them so the static analysis will work still.
After these changes, I receive no errors using flow `0.60.1` on latest master, or using `0.59` in my local project (which does not have the requisite ignores included).
- init a new project
`react-native init --version <path-to-repo> helloworld`
- add the flow binary
`yarn add -D flow-bin`
- run flow
`yarn flow`
- make sure there are no errors in the project.
```
No errors!
✨ Done in 23.60s.
```
<!--
Help reviewers and the release process by writing your own release notes
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [-{Component}-]
[ INTERNAL ] [ ENHANCEMENT ] [ {File} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
[CATEGORY] [TYPE] [LOCATION] - MESSAGE
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[GENERAL][BUGFIX][./Libraries] - Fix up some flow definitions
Closes https://github.com/facebook/react-native/pull/17086
Differential Revision: D6509112
Pulled By: hramos
fbshipit-source-id: a61145b5306c666ab6510ccb9eea02d96f3decb3
Summary:
WIP: Starting point insofar as I'm not sure if there should be an Android equivalent.
My application needs me to delete photos from the photos in iOS.
I have tested this in my application and it works, have a screenshot from iOS asking as well and it does successfully delete the photos from the global Photos app.
Related to https://github.com/facebook/react-native/issues/15253, it kind of continues using the deprecated assets-library framework, but that does need (and will be an bigger and bigger issue coming up) of assets-library URLs being used.
I also assume RN prefers error handling at the JS level? Are the URLs starting with `asset-library`, etc.
Closes https://github.com/facebook/react-native/pull/15481
Differential Revision: D6438016
Pulled By: hramos
fbshipit-source-id: 47512140f62f458c14ad2ade2b358846e168c964
Summary:
I was confused by the current documentation, as it was requesting me to pass the previously received `end_cursor` into the next fetch but it was declared as a boolean. I checked in the debugger and it's just mislabeled in the docs, so this PR fixes the docs.
I tried to push this change back in #15472 but wasn't able to undo the borked rebase, so I'm submitting a new PR.
This is a change to documentation only.
[DOCS] [BUGFIX] [Libraries/CameralRoll/CameraRoll.js] - Corrected return type in the documentation for the `start_cursor` and `end_cursor` values.
Closes https://github.com/facebook/react-native/pull/16830
Differential Revision: D6371585
Pulled By: hramos
fbshipit-source-id: 5038041e95a04ea4c2de8d2b535a8a4e019289f6
Summary:
Example for loading Media using CameraRoll getPhotos method
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.
You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html
Happy contributing!
-->
The cameraRoll API doesn't have a proper example of how to use the methods. So, I decided to provide a basic example with a use case.
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes https://github.com/facebook/react-native/pull/15647
Differential Revision: D5748965
Pulled By: hramos
fbshipit-source-id: df8ad50d597dcc745a7f6abcc52839695ffe452c
Summary:
Hi React Native folks! Love your work!
To make contributing easier, this sets the indentation settings of all the Xcode projects to 2 spaces to match their contents.
Closes https://github.com/facebook/react-native/pull/15275
Differential Revision: D5526462
Pulled By: javache
fbshipit-source-id: cbf0a8a87a1dbe31fceed2f0fffc53839cc06e59
Summary:
The last in my series of :atom: migrations. More to come!
Closes https://github.com/facebook/react-native/pull/15279
Differential Revision: D5526467
Pulled By: javache
fbshipit-source-id: 02b37387c8c47af9ffe42b938ddcf17eb15b916f
Summary:
- [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 CameraRoll docs have a method for `saveImageWithTag`. I wanted to know how to use it and how it differs from the other methods. So I open the react-native repo and used the source.
I discovered this method is deprecated. It does use a console warning to notify upon use. A developer should not have to use a deprecated method to know it's no longer supported. The docs should state this until it is removed from the library.
```bash
git clone https://github.com/facebook/react-native.git
cd react-native
npm install
cd website
npm install
npm start
open http://localhost:8079/react-native/docs/cameraroll.html
```
Verify there are comments for `saveImageWithTag` method notifying developers that it is deprecated.
Closes https://github.com/facebook/react-native/pull/14345
Differential Revision: D5198453
Pulled By: shergin
fbshipit-source-id: 2b74120a1ee450b903cdcff3812a83747dac5bb8
Summary:
Currently, Android camera roll videos cannot be retrieved in RN since
1) `CameraRollManager.java` doesn't do anything with the `assetType` param
2) Unspecifying MIME types doesn't show videos
This diff allows videos to be shown in the `CameraRoll.getPhotos(..)` call by reading `assetType`. Future diffs will come where the thumbnail and other info will be returned as well.
Reviewed By: furdei
Differential Revision: D5019202
fbshipit-source-id: a920273761b31f1a59ba6b8bc49c05852506829c
Summary: Exporting an object instead of an array so it can be used as an enum by other files.
Reviewed By: sahrens
Differential Revision: D5007488
fbshipit-source-id: 8253a424f0dbb51511b889b1da637f366c0f290a
Summary:
- [x] Explain the **motivation** for making this change.
- [ ] ~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 key name required to access the CameraRoll in iOS is incorrect.
Closes https://github.com/facebook/react-native/pull/13755
Differential Revision: D4994048
Pulled By: javache
fbshipit-source-id: 9ec2f793f03f529e9cf0f89106f88445fde50f2a
Summary: The xcode project for these bundled libraries should not depend on UIExplorer
Reviewed By: yungsters
Differential Revision: D4979629
fbshipit-source-id: 440b225805e9ebaf0a02b39a35c3ab9c2a83ad05
Summary:
This is enforced for all of our internal iOS code and a common cause of import failures.
cc janicduplessis
Closes https://github.com/facebook/react-native/pull/13124
Differential Revision: D4765016
fbshipit-source-id: 7c8248c98bca0fa6bad24d5a52b666243375e0db
Summary:
**Motivation**:
The `CameraRoll.getPhotos()` documentation is lacking, I've simply exposed the shapes of the params object and returned object, as defined and documented in `getPhotosParamChecker` and `getPhotosReturnChecker`.
**Test plan**:
Built the website and checked the documentation.
Closes https://github.com/facebook/react-native/pull/12524
Differential Revision: D4608419
Pulled By: hramos
fbshipit-source-id: 887d32b32312a492e57bf65fca503891de0bd661
Summary:
The DCIM folder is a better mapping to a "CameraRoll" than the "movies" or "pictures" directories.
https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DCIM
```
DIRECTORY_DCIM
The traditional location for pictures and videos when mounting the device as a camera.
Note that this is primarily a convention for the top-level public directory, as this convention makes no sense elsewhere.
```
**Test plan**
- Make sure tests pass on both Travis and Circle CI.
- Test `saveToCameraRoll` in an example app, and check it is saved to the expected folder in a photos app.
Closes https://github.com/facebook/react-native/pull/12059
Differential Revision: D4500946
Pulled By: mkonicek
fbshipit-source-id: 8af994492303c175374502dffe6fd2f3e4e9975e
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?
I had tried fixing a broken link in a previous commit (#11453). My commit was merged, but it did not resolve the underlying problem. I have looked into how links should be formed for the docs and have fixed the original problem as well as updated all other links to be consistent.
Previous link formats:
- /docs/sample.html <-- broken link
- sample.html <-- broken link
- https://facebook.github.io/react-native/docs/sample.html <-- works
- /react-native/docs/sample.html <-- works
- docs/sample.html <-- works (permalink format)
This PR updates all links to the permalink format.
**Test plan (required)**
I ran the website locally and manually tested half of the links in each category. They all worked.
```
$ cd website
$ npm install && npm start
```
Closes https://github.com/facebook/react-native/pull/12064
Differential Revision: D4489153
Pulled By: mkonicek
fbshipit-source-id: bf0231d941ba147317595c3b3466dc579a887169