Commit Graph

54 Commits

Author SHA1 Message Date
Eli White 61d046be3c Flow Type ActionSheetIOS
Reviewed By: sahrens

Differential Revision: D6548474

fbshipit-source-id: dac0cb2cdd85bc49d4302b4382142fd70ab4ecc4
2017-12-13 16:19:21 -08:00
Oleg Lokhvitsky dab313a0de Revert D6437807: [react-native][PR] Generalize ActionSheetManager items URL
Differential Revision: D6437807

fbshipit-source-id: 2d859c7e4d88950ec070813ec40f08685a5d6b44
2017-12-11 11:07:43 -08:00
Edgar Aroutiounian 2e424fb113 Generalize ActionSheetManager items URL
Summary:
Not ready but want to start conversation.  (i.e. not sure if to change key name to `urls` from `url`)

I want to be able to share more than 1 image at a time, the current code only lets one use one url, but the API allows for much more.

Some places already make this an issue:

https://github.com/EstebanFuentealba/react-native-share/issues/85

And I also need to be able to email/send on iMessage, etc with multiple URL resources.
Closes https://github.com/facebook/react-native/pull/15475

Differential Revision: D6437807

Pulled By: hramos

fbshipit-source-id: 336c696c5633c0080904ca9306a38120e27f9173
2017-11-29 12:01:48 -08:00
Héctor Ramos 79e24ede40 Migrate additional docs to the new format
Summary:
[DOCS]
Closes https://github.com/facebook/react-native/pull/16874

Differential Revision: D6375515

Pulled By: hramos

fbshipit-source-id: 64359b45a37c7b478919121573ca04dbb1ce6609
2017-11-20 13:16:12 -08:00
Patrick Kempff 1ee64ccb8a Add tintColor to ActionSheetIOS documentation
Summary:
This pr adds documentation for the tintColor addition of #4590

<!--
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 tintColor was missing from the documentation but works perfectly fine.

Added a tintColor to showActionSheetWithOptions and showShareActionSheetWithOptions in the app i am building right now.

[DOCS][MINOR][ActionSheetIOS] - Added documentation for tintColor in ActionSheet.
Closes https://github.com/facebook/react-native/pull/16679

Differential Revision: D6248070

Pulled By: shergin

fbshipit-source-id: a2276f50b42ff2c5858008f3641c9607f248744a
2017-11-06 10:39:55 -08:00
Lukas Kurucz bbc3f603f1 Add minimal example to actionsheet
Summary:
Easier to understand how to use this component. A quick example helps to beginners.
Closes https://github.com/facebook/react-native/pull/16110

Differential Revision: D6017956

Pulled By: shergin

fbshipit-source-id: 82a340dfe8551cc8d7b692b9c71237e2b4421aba
2017-10-10 03:32:08 -07:00
Petter Hesselberg 5317b68e27 Improved documentation for ActionSheetIOS.js
Summary:
This change improves the documentation for `ActionSheetIOS.js`. It's a bit skimpy as is.
Closes https://github.com/facebook/react-native/pull/16030

Differential Revision: D5882446

Pulled By: hramos

fbshipit-source-id: b59ce299a9142ebf015ed674c59e1e435deb759a
2017-09-21 11:55:29 -07:00
Adlai Holler 0f440130b6 Standardize project indentation settings on 2 spaces
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
2017-07-31 05:20:03 -07:00
Pieter De Baets 7c9173bc9e Enable -Wimplicit-retain-self en sync warning config for all projects
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
2017-03-23 15:01:34 -07:00
Pieter De Baets 59407f3660 Redo exported headers and include paths for opensource
Summary:
Xcode really sucks, per some discussion on e1577df1fd and https://developer.apple.com/library/content/technotes/tn2215/_index.html, if you use the headers phase, and mark headers in your static library as public, they will actually end up in the final package that's built and you can't submit to the app store! This changes our xcode setup to use a copy files phase instead.

I've also changed the header include path to be $(BUILT_PRODUCTS_DIR)/include, which is added to the include path by Xcode by default, so 3rd party libraries should not be impacted by these changes anymore.

Reviewed By: mkonicek

Differential Revision: D4291607

fbshipit-source-id: 969b9ebcbeb8161f85427f8c429e198d9d0fae30
2016-12-07 15:28:29 -08:00
Pieter De Baets e1577df1fd Move all header imports to "<React/..>"
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
2016-11-23 07:58:39 -08:00
Pieter De Baets 7c91f894ba Fix CSSLayout import hack, update podspec
Summary: Correct header import paths, update podspec so we point at the copy in ReactCommon (and can eventually remove the copy under React)

Reviewed By: astreet

Differential Revision: D4204501

fbshipit-source-id: e979a010092f025b2cdc289e1e5f22fc7b65a8d1
2016-11-21 09:13:36 -08:00
sheparddw 4f004fa3e5 ActionSheetIOS - Pass URL, not file contents to UIActivityViewController for file URLs.
Summary:
Currently, when sharing local files, the file contents are being sent as NSData causing the file to never be attached when sharing via Email or via Airdrop, being renamed to something obscure such as (null)-257D026032E9-1.data
Simply passing the Local File URL to UIActivityViewController instead of the file contents resolves this issue.
More info on this issue: https://github.com/facebook/react-native/issues/8442
Closes https://github.com/facebook/react-native/pull/9693

Differential Revision: D3821142

Pulled By: javache

fbshipit-source-id: a06128db88d24cf5565169f321365ace43ab89fe
2016-09-06 04:43:36 -07:00
Pieter De Baets 07553d0f1c Update React Native minimum OS version to iOS8
Reviewed By: majak

Differential Revision: D3723143

fbshipit-source-id: 482f9820370b752d937e6df7f74c33d53a0a2e7d
2016-09-01 19:43:47 -07:00
Veljko Tornjanski a9a51b2d21 Documentation typo
Summary: Closes https://github.com/facebook/react-native/pull/9554

Differential Revision: D3763036

Pulled By: hramos

fbshipit-source-id: b545b015c4c764b5fab7d84cd003e790a7e7a242
2016-08-24 02:58:32 -07: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
Pieter De Baets b91bf8eeac Update RCTActionSheetManager.m
Summary:
We use [self bridge] in this class but weren't synthesizing the bridge getters/setters.

Fixes https://github.com/facebook/react-native/issues/7890
Closes https://github.com/facebook/react-native/pull/7909

Differential Revision: D3390538

fbshipit-source-id: d75a1976af01b21887ddad5060ce635cf84abadd
2016-06-04 16:28:19 -07:00
Christian Ost 8fe58849a5 Update the documenation of ActionSheetIOS to include all possible options
Summary:
As it is shown in the examples, `subject` and `excludedActivityTypes` should be part of the documentation. `excludedActivityTypes` could be completed by a list of all possible options (see [UIActivity](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActivity_Class/#//apple_ref/doc/constant_group/Built_in_Activity_Types) documentation of Apple).

Screenshots of updated documentation:
![actionsheetios](https://cloud.githubusercontent.com/assets/12033337/15772879/0e54ca98-2974-11e6-9af5-df76c093ec5a.png)
Closes https://github.com/facebook/react-native/pull/7908

Differential Revision: D3384642

Pulled By: javache

fbshipit-source-id: 837e50eeabbcd532baf5ea1d4f8a64267c93c6ce
2016-06-03 02:58:31 -07:00
Mike Grabowski 4446e31b5d ActionSheetIOS - support share sheet on modals
Summary:
Fixes #6913 - follow up to this commit 43dcdaffe2 to support this in the 2nd method as well.
Closes https://github.com/facebook/react-native/pull/7244

Differential Revision: D3330843

fbshipit-source-id: 0923440550a7635202158b4afaba87e12f1c1d54
2016-05-20 17:13:21 -07:00
Nick 2a03182b1c CHORE - Remove Trailing Spaces
Summary:Remove Trailing Spaces.

Why:
Sometimes there are conflicts with trailing spaces
Saves space
Those whose tools automatically delete them will have their pr watered down with trailing space removal
Closes https://github.com/facebook/react-native/pull/6787

Differential Revision: D3144704

fb-gh-sync-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
fbshipit-source-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
2016-04-06 09:21:53 -07:00
Lane Rettig 928fd0d605 Add support for "message" option to ActionSheetIOS and improve docs
Summary:Updated docs:

![screen shot 2016-03-27 at 12 41 02](https://cloud.githubusercontent.com/assets/3316532/14066504/35509612-f419-11e5-923f-e354ad939ee5.png)
Closes https://github.com/facebook/react-native/pull/6685

Differential Revision: D3119791

Pulled By: javache

fb-gh-sync-id: fadd5ea1a1b979f79b41c80b6a19fdb9ea3f100f
fbshipit-source-id: fadd5ea1a1b979f79b41c80b6a19fdb9ea3f100f
2016-03-30 22:10:31 -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
Nick Lockwood e6c65102d4 Add support for sharing images or other media via iOS share sheet
Summary:`ActionSheetIOS` now supports sharing images or other media via the `showShareActionSheetWithOptions` method. Simply specify a local file or data uri using the `url` argument to share the file.

NOTE: this mechanism doesn't currently support sharing images from the camera roll, however you can work around this by first saving the image to the ImageStore, and then fetching the base64 data.

Reviewed By: javache

Differential Revision: D2954273

fb-gh-sync-id: d5158f9d167fe92199933ca703f40f561732ac37
shipit-source-id: d5158f9d167fe92199933ca703f40f561732ac37
2016-02-22 05:34:32 -08:00
Morgan Pretty 43dcdaffe2 ActionSheetIOS support for presentation from modal view controller
Summary:
Currently the RCTActionSheetManager attempts to present itself from the 'rootViewController' of the key window, presenting a modal from a view controller which is already presenting a modal is not allowed on iOS and this fails with the following error appearing in the XCode debugger (but not the chrome debugger):

```
Warning: Attempt to present <UIAlertController: 0x7fca85b14f40> on <UINavigationController: 0x7fca84812000> whose view is not in the window hierarchy!
```

This change recursively looks through modally presented view controllers until it finds the top one and then uses that to present the action sheet.
Closes https://github.com/facebook/react-native/pull/5263

Reviewed By: svcscm

Differential Revision: D2823201

Pulled By: nicklockwood

fb-gh-sync-id: aad1ad88115563f633fd9aaea8e27d1d155a6c27
2016-01-12 03:14:35 -08:00
Christopher Dro 86bb656e6f Add tintColor for buttons.
Summary:
Closes #3374
Closes https://github.com/facebook/react-native/pull/4590

Reviewed By: javache

Differential Revision: D2729616

Pulled By: mkonicek

fb-gh-sync-id: 4a3b6de10a09cad73dbd9d5d552adc3f6ba054e0
2015-12-09 05:19:25 -08:00
Andreas Amsenius 0f0b57880f ActionSheetIOS sharing exclude activity types
Summary: Closes https://github.com/facebook/react-native/pull/4427

Reviewed By: svcscm

Differential Revision: D2702825

Pulled By: nicklockwood

fb-gh-sync-id: f12e83332f2083cee2c04625b5113774c8a907e0
2015-11-30 06:20:30 -08:00
dajomu 0bf7928ebe Added Subject to ActionSheetIOS share options and updated example
Summary: I've added a subject property to the ActionSheetIOS.showShareActionSheetWithOptions options object. This will allow users to set a subject for things like emails when they are sharing to them through the ActionSheetIOS.
Options are now as follows:
```
{
   url: 'https://code.facebook.com',
   message: 'message to go with the shared url',
   subject: 'a subject to go in the email heading',
}
```
Closes https://github.com/facebook/react-native/pull/4238

Reviewed By: svcscm

Differential Revision: D2674536

Pulled By: nicklockwood

fb-gh-sync-id: 3dfad39f94f19999233bf777253ef71b6e692a6d
2015-11-19 08:42:31 -08:00
Nick Lockwood 11df4cb08c Fixed display of alerts on top of modal window
Reviewed By: javache

Differential Revision: D2616170

fb-gh-sync-id: f72f728008099fff6fc966d7a2ce4c0d27a4fefd
2015-11-05 03:54:31 -08:00
Nick Lockwood c5b990f65f Added lightweight generic annotations
Summary: public

Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs.

Fixed some type bugs and improved bridge validation in a few places.

Reviewed By: javache

Differential Revision: D2600189

fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
2015-11-03 14:49:30 -08:00
Nick Lockwood a859d9e931 Fixed ActionSheetIOS on iOS 9 SDK
Summary: public

UIActionSheet no longer works on iPad when building with the iOS 9 SDK, as reported here: https://github.com/facebook/react-native/issues/3498

This diff implements an alernative code path that uses UIAlertController instead when its available.

Also added `anchor` support for action sheets (previously only supported for share sheet).

Reviewed By: javache

Differential Revision: D2560068

fb-gh-sync-id: feda20f6f1fee5e2ba624761fbeb812e23d96fff
2015-10-21 12:21:28 -07:00
Yusef Napora 2f9bd1f62f App Extension support
Summary: This adds workarounds for the code that was preventing React from compiling when linked against an iOS App Extension target.

Some iOS APIs are unavailable to App Extensions, and Xcode's static analysis will catch attempts to use methods that have been flagged as unavailable.

React currently uses two APIs that are off limits to extensions: `[UIApplication sharedApplication]` and `[UIAlertView initWith ...]`.

This commit adds a helper function to `RCTUtils.[hm]` called `RCTRunningInAppExtension()`, which returns `YES` if, at runtime, it can be determined that we're running in an app extension (by checking whether the path to `[NSBundle mainBundle]` has the `"appex"` path extension).

It also adds a `RCTSharedApplication()` function, which will return `nil` if running in an App Extension. If running in an App, `RCTSharedApplication()` calls `sharedApplication` by calling `performSelector:` on the `UIApplication` class.  This passes the static analysis check, and, in my opinion, obeys the "spirit of th
Closes https://github.com/facebook/react-native/pull/1895

Reviewed By: @​svcscm

Differential Revision: D2224128

Pulled By: @nicklockwood
2015-09-22 10:46:26 -07:00
Param Aggarwal f35fbc2a14 Fixes consistent crash on iPad with iOS 8 while sharing.
Summary: (Fixes #1890, #2395, #2604.)

Usage:
```
ActionSheetIOS.showShareActionSheetWithOptions({
  anchor: React.findNodeHandle(this.refs.share),
  message: "React Native",
  url: "https://github.com/facebook/react-native"
}, (e)=>{ console.log('shared'); }, (e)=>{console.log('dismissed'); });
```

Screenshot on iPad with iOS 8:

<img width="324" alt="screen shot 2015-09-09 at 8 50 26 am" src="https://cloud.githubusercontent.com/assets/543981/9752590/df5cd324-56cf-11e5-892b-92a6c98f3d39.png">

If the `anchor` is not specified, it will centre the popup on screen without arrows:

![centered](https://cloud.githubusercontent.com/assets/543981/9752612/10c87c6a-56d0-11e5-8c59-fcbf64a36f9c.png)

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

Reviewed By: @nicklockwood

Differential Revision: D2439533

Pulled By: @javache
2015-09-15 11:35:26 -07:00
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Nick Lockwood 8d1e02b8bd Convert alloc/init to new to please linter 2015-08-17 08:46:00 -07:00
Nick Lockwood f165bbaf4e Use +[RCTConvert NSURL:] everywhere instead of +[NSURL URLWithString:]
Summary:
RCTConvert's URL: method gracefully handles unescaped urls, local file urls, urls containing unicode, etc. URLWithString doesn't.
2015-08-04 16:26:16 -08:00
Nick Lockwood ef5cec4f08 Text highlighting on iOS
Summary:
This diff implements highlighting of tapped text subranges for the iOS `<Text>` component, styled to match how iOS webkit views highlight links (translucent grey overlay with rounded corners).

Highlighting is enabled by default for any `<Text>` component which has an onPress handler. To disable the highlight, add `suppressHighlighting={true}` to the component props.
2015-07-24 08:41:58 -08:00
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -08:00
Tadeu Zagallo 2a7adfb815 [ReactNative] Use RCTNullIfNill and (id)kCFNull
Summary:
@public

Use consistent `null` handling:

`value || null`                ->  `RCTNullIfNil(value)`
`value == null ? nil : value`  ->  `RCTNilIfNull(value)`
`[NSNull null]`                ->  `(id)kCFNull`

Test Plan: The tests should be enough.
2015-06-12 11:03:10 -08:00
Tadeu Zagallo d293bed5ab [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
Nick Lockwood 5ce9fa4dda Changed default method queue to a background queue. 2015-04-20 12:02:04 -08:00
Nick Lockwood ead0f2e020 Implemented thread control for exported methods 2015-04-18 11:13:39 -08:00
Alex Akers 8a57c4e980 [React Native] RCT_EXPORT lvl.2 2015-04-08 08:34:10 -08:00
Nick Lockwood bf4868edda Added non-class-scanning-based approach fror registering js methods 2015-04-08 05:45:20 -08:00
laiso e35521300a (Xcode) Set indent=2 in all xcodeproj files.
Summary:
These are default settings now.
I saw my Xcode be configured indent=4.

![2015-03-30 12 16 11 pm](https://cloud.githubusercontent.com/assets/39830/6889697/98f8b930-d6d6-11e4-81c8-d2146855d127.png)

Closes https://github.com/facebook/react-native/pull/472
Github Author: laiso <laiso@lai.so>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-01 17:14:45 -08:00
Tadeu Zagallo 20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00
Nick Lockwood 19e328fb08 Added explicit types for all view properties 2015-03-25 21:20:24 -08:00
Basil Hosmer e4bf45beee flowify some Libraries 2015-03-24 13:27:00 -08:00
Christopher Chedeau 1aeb02ada3 [ReactNative] Expanded license on obj-c files 2015-03-23 13:18:29 -08:00
Christopher Chedeau e1ef0328d9 [ReactNative] Expanded license on js files 2015-03-23 13:17:54 -08:00
Alex Akers 48cc440bd3 [React Native] Fix iOS 7 crashes b/c missing Photos.fmwk 2015-03-23 08:06:58 -08:00