├── .flowconfig ├── .gitignore ├── LICENSE ├── README.md ├── ReactNativeSocialShare.xcodeproj ├── project.pbxproj └── xcshareddata │ └── xcschemes │ └── ReactNativeSocialShare.xcscheme ├── ReactNativeSocialShareTests ├── Info.plist └── ReactNativeSocialShareTests.m ├── android ├── build.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── barefootcoders │ └── android │ └── react │ └── KDSocialShare │ ├── KDSocialShare.java │ └── KDSocialShareModule.java ├── assets ├── animation-looping.gif ├── animation.gif └── still.png ├── iOS ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ └── LaunchScreen.xib ├── Images.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── KDSocialShare.h ├── KDSocialShare.m ├── main.jsbundle └── main.m ├── package.json └── react-native-social-share.js /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ignore react-tools where there are overlaps, but don't ignore anything that 11 | # react-native relies on 12 | .*/node_modules/react-tools/src/vendor/core/ExecutionEnvironment.js 13 | .*/node_modules/react-tools/src/browser/eventPlugins/ResponderEventPlugin.js 14 | .*/node_modules/react-tools/src/browser/ui/React.js 15 | .*/node_modules/react-tools/src/core/ReactInstanceHandles.js 16 | .*/node_modules/react-tools/src/event/EventPropagators.js 17 | 18 | # Ignore jest 19 | .*/react-native/node_modules/jest-cli/.* 20 | 21 | [include] 22 | 23 | [libs] 24 | node_modules/react-native/Libraries/react-native/react-native-interface.js 25 | 26 | [options] 27 | module.system=haste 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # node.js 26 | # 27 | node_modules/ 28 | npm-debug.log 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Cory Smith 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native Social Share 2 | 3 | Use the built-in share view from iOS and Android to let the user share on Facebook and Twitter. 4 | It will use the user's existing account without having to get new authorizations. 5 | You can even preset text, image and link for the share view. 6 | 7 | In other words a React Native wrapper for the `SLComposeViewController` 8 | 9 | __Support for Android__ 10 | 11 | 27 Feb 2017 - @minhtule has made improvements to sharing on Android 12 | 13 | 10 Feb 2017 - @Jberlinsky has added support for Android 14 | 15 | Let me know how it works. 16 | 17 | 18 | 19 | ![Animation](https://raw.githubusercontent.com/doefler/react-native-social-share/master/assets/animation-looping.gif) 20 | 21 | 22 | ## Getting started 23 | 24 | 1. `npm install react-native-social-share --save` 25 | 2. `react-native link` 26 | 3. In XCode, in the project navigator right click `Libraries` ➜ `Add Files to [your project's name]` 27 | 4. Go to `node_modules` ➜ `react-native-social-share`➜ iOS and add `KDSocialShare.h` and `KDSocialShare.m` 28 | 5. Go to your project's `Build Phases` ➜ `Link Binary With Libraries` phase 29 | 6. Add `Social.framework` to ➜ `Link Binary With Libraries` build phase of your project (click the '+' and search for 'social'). 30 | 7. Add 'LSApplicationQueriesSchemes' key (Type: Array) with items (Type: String) 'fb' and 'twitter' to `Info.plist` of your project 31 | 8. Run your project (`Cmd+R`) 32 | 33 | Now you can implement the share popups in your react native code. 34 | 35 | ## Example of implementation 36 | 37 | First you should make the native implementation available in the react code by inserting the following line in the top of the file 38 | ``` JavaScript 39 | import { 40 | shareOnFacebook, 41 | shareOnTwitter, 42 | } from 'react-native-social-share'; 43 | ``` 44 | After doing that you will be able to popup the share views from your own functions. I made two examples below, one for Facebook and one for Twitter 45 | ``` JavaScript 46 | tweet : function() { 47 | 48 | shareOnTwitter({ 49 | 'text':'Global democratized marketplace for art', 50 | 'link':'https://artboost.com/', 51 | 'imagelink':'https://artboost.com/apple-touch-icon-144x144.png', 52 | //or use image 53 | 'image': 'artboost-icon', 54 | }, 55 | (results) => { 56 | console.log(results); 57 | } 58 | ); 59 | }, 60 | 61 | facebookShare : function() { 62 | 63 | shareOnFacebook({ 64 | 'text':'Global democratized marketplace for art', 65 | 'link':'https://artboost.com/', 66 | 'imagelink':'https://artboost.com/apple-touch-icon-144x144.png', 67 | //or use image 68 | 'image': 'artboost-icon', 69 | }, 70 | (results) => { 71 | console.log(results); 72 | } 73 | ); 74 | }, 75 | ``` 76 | 77 | The two implementations take the following parameters 78 | 79 | - `shareOnFacebook(options [object], callback [function])` 80 | - `shareOnTwitter(options [object], callback [function])` 81 | 82 | #### IMPORTANT Both the options object and the callback function needs to be set. The options object can be empty though if you do not want to preset any of the possible options. 83 | 84 | ### Options 85 | The options object lets you pre-populate the share view for the user. You can use the following parameters: 86 | 87 | | Parameter | Desciption | 88 | | ------------- | ------------- | 89 | | text | Sets the initial text of the message on the SLComposeViewController instance. | 90 | | imagelink | Adds an image file from the given publicly available URL as attachments to the message. | 91 | | image | Adds an image file from the xcode image assets. image takes priority over imagelink. Only one out of two will load. | 92 | | link | Adds a URL to the message. The method automatically handles the URL shortening. | 93 | 94 | **At least the `text` or `link` parameter must be specified** 95 | 96 | ### Special Case: Facebook on Android 97 | 98 | Due to [various known problems](http://stackoverflow.com/questions/23541823/how-to-share-text-and-image-on-facebook-using-intent) with Facebook's implementation of Android Intents, sharing with Facebook on Android can only be done in two ways: 99 | 100 | 1. If the user has the Facebook application installed, and the `text` parameter is provided; or 101 | 2. If the `link` parameter is provided. 102 | 103 | Only one of the `link` or `text` parameter can be passed to the `shareWithFacebook` method on Android devices. Image parameters are ignored entirely. 104 | 105 | We recommend using the [official Facebook SDK](https://developers.facebook.com/docs/sharing/android) to perform more complex sharing operations on Android. 106 | 107 | 108 | ### Callback 109 | The callback function runs when the native environment has information for the react environment. **Note that some callbacks are only available on iOS due to platform limitations** 110 | 111 | | Callback | Desciption | iOS | Android | 112 | | ------------- | ------------- | ----| ------- | 113 | | "success" | Native call made by the viewController - SLComposeViewControllerResultDone – The user sent the composed message by touching the Send button. | Yes | No | 114 | | "cancelled" | Native call made by the viewController - SLComposeViewControllerResultCancelled – The user cancelled the composition session by touching the Cancel button. | Yes | No | 115 | | "not_available" | The selected service eg. Facebook, is not available. This can be because the user has not signed in to Facebook on the device or maybe there is no internet access. | Yes | No (Android functionality falls back to web views) | 116 | | "missing\_link\_or\_text" | Neither the `link` nor `text` parameter was provided | Yes | Yes | 117 | 118 | You can use these callbacks to present alerts to the user. For example tell the user to login to a certain service. 119 | 120 | 121 | ## The full example code 122 | ``` JavaScript 123 | 'use strict'; 124 | 125 | var React = require('react-native'); 126 | var { 127 | AppRegistry, 128 | StyleSheet, 129 | Text, 130 | View, 131 | TouchableHighlight, 132 | } = React; 133 | 134 | import { 135 | shareOnFacebook, 136 | shareOnTwitter, 137 | } from 'react-native-social-share'; 138 | 139 | 140 | var ReactNativeSocialShare = React.createClass({ 141 | 142 | tweet : function() { 143 | 144 | shareOnTwitter({ 145 | 'text':'Global democratized marketplace for art', 146 | 'link':'https://artboost.com/', 147 | 'imagelink':'https://artboost.com/apple-touch-icon-144x144.png', 148 | //or use image 149 | 'image': 'artboost-icon', 150 | }, 151 | (results) => { 152 | console.log(results); 153 | } 154 | ); 155 | }, 156 | 157 | facebookShare : function() { 158 | 159 | shareOnFacebook({ 160 | 'text':'Global democratized marketplace for art', 161 | 'link':'https://artboost.com/', 162 | 'imagelink':'https://artboost.com/apple-touch-icon-144x144.png', 163 | //or use image 164 | 'image': 'artboost-icon', 165 | }, 166 | (results) => { 167 | console.log(results); 168 | } 169 | ); 170 | }, 171 | 172 | 173 | render: function() { 174 | return ( 175 | 176 | 177 | Twitter and Facebook share 178 | 179 | 180 | 181 | Try tapping one of the buttons 182 | 183 | 184 | 185 | 186 | 187 | 188 | Share on Twitter 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | Share on Facebook 197 | 198 | 199 | 200 | 201 | 202 | ); 203 | } 204 | }); 205 | 206 | var styles = StyleSheet.create({ 207 | container: { 208 | flex: 1, 209 | justifyContent: 'center', 210 | alignItems: 'center', 211 | backgroundColor: '#F5FCFF', 212 | }, 213 | welcome: { 214 | fontSize: 20, 215 | textAlign: 'center', 216 | margin: 10, 217 | }, 218 | seperator:{ 219 | marginBottom: 20 220 | } 221 | }); 222 | 223 | AppRegistry.registerComponent('ReactNativeSocialShare', () => ReactNativeSocialShare); 224 | 225 | ``` 226 | 227 | ## Done 228 | 229 | ![Screenshot](https://raw.githubusercontent.com/doefler/react-native-social-share/master/assets/still.png) 230 | 231 | 232 | ## Who is using it 233 | 234 | * [ec-deploy-mobile](https://github.com/artyomtrityak/ec-deploy-mobile) by [artyomtrityak](https://github.com/artyomtrityak) 235 | * [react-native-recipes-app](https://github.com/push23/react-native-recipes-app) by [push23](https://github.com/push23) 236 | * [drumpfgenerator-mobile](https://github.com/si74/drumpfgenerator-mobile) by [si74](https://github.com/si74) 237 | * [best_quotes_native_app](https://github.com/anamariasosam/best_quotes_native_app) by [anamariasosam](https://github.com/anamariasosam) 238 | * [Concert](https://github.com/aakashsigdel/Concert) by [aakashsigdel](https://github.com/aakashsigdel) 239 | * [Synerzip-HRMS-iOS](https://github.com/Synerzip/Synerzip-HRMS-iOS) by [Synerzip](https://github.com/Synerzip) 240 | * [slight-note](https://github.com/Roy9102/slight-note) by [Roy9102](https://github.com/Roy9102) 241 | * [Water](https://github.com/jvt/Water) by [jvt](https://github.com/jvt) 242 | * [smstet](https://github.com/phanthoa/smstet) by [phanthoa](https://github.com/phanthoa) 243 | * [PilotCalendarFinancial](https://github.com/kenvandemar/PilotCalendarFinancial) by [kenvandemar](https://github.com/kenvandemar) 244 | * [devine-v0-app](https://github.com/davidsims9t/devine-v0-app) by [davidsims9t](https://github.com/davidsims9t) 245 | * [rebus](https://github.com/michaelgena/rebus) by [michaelgena](https://github.com/michaelgena) 246 | * [NeedlApp](https://github.com/ghamaide/NeedlApp) by [ghamaide](https://github.com/ghamaide) 247 | * [randomSofar](https://github.com/conorcussell/randomSofar) by [conorcussell](https://github.com/conorcussell) 248 | * [react-native-create-caps](https://github.com/sozkahya/react-native-create-caps) by [sozkahya](https://github.com/sozkahya) 249 | * [DocLibs](https://github.com/IceNeoMax/DocLibs) by [IceNeoMax](https://github.com/IceNeoMax) 250 | * [rebby](https://github.com/michaelgena/rebby) by [michaelgena](https://github.com/michaelgena) 251 | * [PilotFinancialCalendarRedux](https://github.com/kenvandemar/PilotFinancialCalendarRedux) by [kenvandemar](https://github.com/kenvandemar) 252 | * [client-fashion-spotting-app](https://github.com/hmm29/client-fashion-spotting-app) by [hmm29](https://github.com/hmm29) 253 | 254 | 255 | Your contributions and suggestions are welcome. 256 | -------------------------------------------------------------------------------- /ReactNativeSocialShare.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */; }; 11 | 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; }; 12 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 13 | 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */; }; 14 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 15 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 16 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 17 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 18 | 00E356F31AD99517003FC87E /* ReactNativeSocialShareTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ReactNativeSocialShareTests.m */; }; 19 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 20 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 21 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 22 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 23 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 24 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 25 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 26 | 8D78D7851AEC2B470061970B /* KDSocialShare.m in Sources */ = {isa = PBXBuildFile; fileRef = 8D78D7841AEC2B470061970B /* KDSocialShare.m */; }; 27 | 8D78D7911AEC5B270061970B /* Social.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D78D7901AEC5B270061970B /* Social.framework */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXContainerItemProxy section */ 31 | 00481BE51AC0C7FA00671115 /* PBXContainerItemProxy */ = { 32 | isa = PBXContainerItemProxy; 33 | containerPortal = 00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */; 34 | proxyType = 2; 35 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 36 | remoteInfo = RCTWebSocketDebugger; 37 | }; 38 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 39 | isa = PBXContainerItemProxy; 40 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 41 | proxyType = 2; 42 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 43 | remoteInfo = RCTActionSheet; 44 | }; 45 | 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */ = { 46 | isa = PBXContainerItemProxy; 47 | containerPortal = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; 48 | proxyType = 2; 49 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 50 | remoteInfo = RCTAdSupport; 51 | }; 52 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 53 | isa = PBXContainerItemProxy; 54 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 55 | proxyType = 2; 56 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 57 | remoteInfo = RCTGeolocation; 58 | }; 59 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 60 | isa = PBXContainerItemProxy; 61 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 62 | proxyType = 2; 63 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 64 | remoteInfo = RCTImage; 65 | }; 66 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 67 | isa = PBXContainerItemProxy; 68 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 69 | proxyType = 2; 70 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 71 | remoteInfo = RCTNetwork; 72 | }; 73 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 74 | isa = PBXContainerItemProxy; 75 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 76 | proxyType = 2; 77 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 78 | remoteInfo = RCTVibration; 79 | }; 80 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 81 | isa = PBXContainerItemProxy; 82 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 83 | proxyType = 1; 84 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 85 | remoteInfo = ReactNativeSocialShare; 86 | }; 87 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 88 | isa = PBXContainerItemProxy; 89 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 90 | proxyType = 2; 91 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 92 | remoteInfo = React; 93 | }; 94 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 95 | isa = PBXContainerItemProxy; 96 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 97 | proxyType = 2; 98 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 99 | remoteInfo = RCTLinking; 100 | }; 101 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 102 | isa = PBXContainerItemProxy; 103 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 104 | proxyType = 2; 105 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 106 | remoteInfo = RCTText; 107 | }; 108 | /* End PBXContainerItemProxy section */ 109 | 110 | /* Begin PBXFileReference section */ 111 | 00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocketDebugger.xcodeproj; path = "node_modules/react-native/Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj"; sourceTree = ""; }; 112 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = main.jsbundle; path = iOS/main.jsbundle; sourceTree = ""; }; 113 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 114 | 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAdSupport.xcodeproj; path = "node_modules/react-native/Libraries/AdSupport/RCTAdSupport.xcodeproj"; sourceTree = ""; }; 115 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 116 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 117 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 118 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 119 | 00E356EE1AD99517003FC87E /* ReactNativeSocialShareTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ReactNativeSocialShareTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 120 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 121 | 00E356F21AD99517003FC87E /* ReactNativeSocialShareTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReactNativeSocialShareTests.m; sourceTree = ""; }; 122 | 13B07F961A680F5B00A75B9A /* ReactNativeSocialShare.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ReactNativeSocialShare.app; sourceTree = BUILT_PRODUCTS_DIR; }; 123 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = iOS/AppDelegate.h; sourceTree = ""; }; 124 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = iOS/AppDelegate.m; sourceTree = ""; }; 125 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 126 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = iOS/Images.xcassets; sourceTree = ""; }; 127 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = iOS/Info.plist; sourceTree = ""; }; 128 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = iOS/main.m; sourceTree = ""; }; 129 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 130 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 131 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 132 | 8D78D7831AEC2B470061970B /* KDSocialShare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = KDSocialShare.h; path = iOS/KDSocialShare.h; sourceTree = ""; }; 133 | 8D78D7841AEC2B470061970B /* KDSocialShare.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = KDSocialShare.m; path = iOS/KDSocialShare.m; sourceTree = ""; }; 134 | 8D78D7901AEC5B270061970B /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; }; 135 | /* End PBXFileReference section */ 136 | 137 | /* Begin PBXFrameworksBuildPhase section */ 138 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 139 | isa = PBXFrameworksBuildPhase; 140 | buildActionMask = 2147483647; 141 | files = ( 142 | ); 143 | runOnlyForDeploymentPostprocessing = 0; 144 | }; 145 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 146 | isa = PBXFrameworksBuildPhase; 147 | buildActionMask = 2147483647; 148 | files = ( 149 | 8D78D7911AEC5B270061970B /* Social.framework in Frameworks */, 150 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 151 | 00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */, 152 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 153 | 00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */, 154 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 155 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 156 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 157 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 158 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 159 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 160 | ); 161 | runOnlyForDeploymentPostprocessing = 0; 162 | }; 163 | /* End PBXFrameworksBuildPhase section */ 164 | 165 | /* Begin PBXGroup section */ 166 | 00481BDC1AC0C7FA00671115 /* Products */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */, 170 | ); 171 | name = Products; 172 | sourceTree = ""; 173 | }; 174 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 175 | isa = PBXGroup; 176 | children = ( 177 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 178 | ); 179 | name = Products; 180 | sourceTree = ""; 181 | }; 182 | 00C302B01ABCB8E700DB3ED1 /* Products */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */, 186 | ); 187 | name = Products; 188 | sourceTree = ""; 189 | }; 190 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 194 | ); 195 | name = Products; 196 | sourceTree = ""; 197 | }; 198 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 202 | ); 203 | name = Products; 204 | sourceTree = ""; 205 | }; 206 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 207 | isa = PBXGroup; 208 | children = ( 209 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 210 | ); 211 | name = Products; 212 | sourceTree = ""; 213 | }; 214 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 218 | ); 219 | name = Products; 220 | sourceTree = ""; 221 | }; 222 | 00E356EF1AD99517003FC87E /* ReactNativeSocialShareTests */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | 00E356F21AD99517003FC87E /* ReactNativeSocialShareTests.m */, 226 | 00E356F01AD99517003FC87E /* Supporting Files */, 227 | ); 228 | path = ReactNativeSocialShareTests; 229 | sourceTree = ""; 230 | }; 231 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 232 | isa = PBXGroup; 233 | children = ( 234 | 00E356F11AD99517003FC87E /* Info.plist */, 235 | ); 236 | name = "Supporting Files"; 237 | sourceTree = ""; 238 | }; 239 | 13B07FAE1A68108700A75B9A /* ReactNativeSocialShare */ = { 240 | isa = PBXGroup; 241 | children = ( 242 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 243 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 244 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 245 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 246 | 13B07FB61A68108700A75B9A /* Info.plist */, 247 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 248 | 13B07FB71A68108700A75B9A /* main.m */, 249 | 8D78D7831AEC2B470061970B /* KDSocialShare.h */, 250 | 8D78D7841AEC2B470061970B /* KDSocialShare.m */, 251 | ); 252 | name = ReactNativeSocialShare; 253 | sourceTree = ""; 254 | }; 255 | 146834001AC3E56700842450 /* Products */ = { 256 | isa = PBXGroup; 257 | children = ( 258 | 146834041AC3E56700842450 /* libReact.a */, 259 | ); 260 | name = Products; 261 | sourceTree = ""; 262 | }; 263 | 78C398B11ACF4ADC00677621 /* Products */ = { 264 | isa = PBXGroup; 265 | children = ( 266 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 267 | ); 268 | name = Products; 269 | sourceTree = ""; 270 | }; 271 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 272 | isa = PBXGroup; 273 | children = ( 274 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 275 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 276 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 277 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 278 | 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */, 279 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 280 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 281 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 282 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 283 | 00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */, 284 | ); 285 | name = Libraries; 286 | sourceTree = ""; 287 | }; 288 | 832341B11AAA6A8300B99B32 /* Products */ = { 289 | isa = PBXGroup; 290 | children = ( 291 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 292 | ); 293 | name = Products; 294 | sourceTree = ""; 295 | }; 296 | 83CBB9F61A601CBA00E9B192 = { 297 | isa = PBXGroup; 298 | children = ( 299 | 8D78D7901AEC5B270061970B /* Social.framework */, 300 | 13B07FAE1A68108700A75B9A /* ReactNativeSocialShare */, 301 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 302 | 00E356EF1AD99517003FC87E /* ReactNativeSocialShareTests */, 303 | 83CBBA001A601CBA00E9B192 /* Products */, 304 | ); 305 | indentWidth = 2; 306 | sourceTree = ""; 307 | tabWidth = 2; 308 | }; 309 | 83CBBA001A601CBA00E9B192 /* Products */ = { 310 | isa = PBXGroup; 311 | children = ( 312 | 13B07F961A680F5B00A75B9A /* ReactNativeSocialShare.app */, 313 | 00E356EE1AD99517003FC87E /* ReactNativeSocialShareTests.xctest */, 314 | ); 315 | name = Products; 316 | sourceTree = ""; 317 | }; 318 | /* End PBXGroup section */ 319 | 320 | /* Begin PBXNativeTarget section */ 321 | 00E356ED1AD99517003FC87E /* ReactNativeSocialShareTests */ = { 322 | isa = PBXNativeTarget; 323 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeSocialShareTests" */; 324 | buildPhases = ( 325 | 00E356EA1AD99517003FC87E /* Sources */, 326 | 00E356EB1AD99517003FC87E /* Frameworks */, 327 | 00E356EC1AD99517003FC87E /* Resources */, 328 | ); 329 | buildRules = ( 330 | ); 331 | dependencies = ( 332 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 333 | ); 334 | name = ReactNativeSocialShareTests; 335 | productName = ReactNativeSocialShareTests; 336 | productReference = 00E356EE1AD99517003FC87E /* ReactNativeSocialShareTests.xctest */; 337 | productType = "com.apple.product-type.bundle.unit-test"; 338 | }; 339 | 13B07F861A680F5B00A75B9A /* ReactNativeSocialShare */ = { 340 | isa = PBXNativeTarget; 341 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeSocialShare" */; 342 | buildPhases = ( 343 | 13B07F871A680F5B00A75B9A /* Sources */, 344 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 345 | 13B07F8E1A680F5B00A75B9A /* Resources */, 346 | ); 347 | buildRules = ( 348 | ); 349 | dependencies = ( 350 | ); 351 | name = ReactNativeSocialShare; 352 | productName = "Hello World"; 353 | productReference = 13B07F961A680F5B00A75B9A /* ReactNativeSocialShare.app */; 354 | productType = "com.apple.product-type.application"; 355 | }; 356 | /* End PBXNativeTarget section */ 357 | 358 | /* Begin PBXProject section */ 359 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 360 | isa = PBXProject; 361 | attributes = { 362 | LastUpgradeCheck = 0610; 363 | ORGANIZATIONNAME = Facebook; 364 | TargetAttributes = { 365 | 00E356ED1AD99517003FC87E = { 366 | CreatedOnToolsVersion = 6.2; 367 | TestTargetID = 13B07F861A680F5B00A75B9A; 368 | }; 369 | 13B07F861A680F5B00A75B9A = { 370 | DevelopmentTeam = GGH293W8JK; 371 | }; 372 | }; 373 | }; 374 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeSocialShare" */; 375 | compatibilityVersion = "Xcode 3.2"; 376 | developmentRegion = English; 377 | hasScannedForEncodings = 0; 378 | knownRegions = ( 379 | en, 380 | Base, 381 | ); 382 | mainGroup = 83CBB9F61A601CBA00E9B192; 383 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 384 | projectDirPath = ""; 385 | projectReferences = ( 386 | { 387 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 388 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 389 | }, 390 | { 391 | ProductGroup = 00C302B01ABCB8E700DB3ED1 /* Products */; 392 | ProjectRef = 00C302AF1ABCB8E700DB3ED1 /* RCTAdSupport.xcodeproj */; 393 | }, 394 | { 395 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 396 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 397 | }, 398 | { 399 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 400 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 401 | }, 402 | { 403 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 404 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 405 | }, 406 | { 407 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 408 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 409 | }, 410 | { 411 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 412 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 413 | }, 414 | { 415 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 416 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 417 | }, 418 | { 419 | ProductGroup = 00481BDC1AC0C7FA00671115 /* Products */; 420 | ProjectRef = 00481BDB1AC0C7FA00671115 /* RCTWebSocketDebugger.xcodeproj */; 421 | }, 422 | { 423 | ProductGroup = 146834001AC3E56700842450 /* Products */; 424 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 425 | }, 426 | ); 427 | projectRoot = ""; 428 | targets = ( 429 | 13B07F861A680F5B00A75B9A /* ReactNativeSocialShare */, 430 | 00E356ED1AD99517003FC87E /* ReactNativeSocialShareTests */, 431 | ); 432 | }; 433 | /* End PBXProject section */ 434 | 435 | /* Begin PBXReferenceProxy section */ 436 | 00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */ = { 437 | isa = PBXReferenceProxy; 438 | fileType = archive.ar; 439 | path = libRCTWebSocketDebugger.a; 440 | remoteRef = 00481BE51AC0C7FA00671115 /* PBXContainerItemProxy */; 441 | sourceTree = BUILT_PRODUCTS_DIR; 442 | }; 443 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 444 | isa = PBXReferenceProxy; 445 | fileType = archive.ar; 446 | path = libRCTActionSheet.a; 447 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 448 | sourceTree = BUILT_PRODUCTS_DIR; 449 | }; 450 | 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */ = { 451 | isa = PBXReferenceProxy; 452 | fileType = archive.ar; 453 | path = libRCTAdSupport.a; 454 | remoteRef = 00C302B31ABCB8E700DB3ED1 /* PBXContainerItemProxy */; 455 | sourceTree = BUILT_PRODUCTS_DIR; 456 | }; 457 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 458 | isa = PBXReferenceProxy; 459 | fileType = archive.ar; 460 | path = libRCTGeolocation.a; 461 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 462 | sourceTree = BUILT_PRODUCTS_DIR; 463 | }; 464 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 465 | isa = PBXReferenceProxy; 466 | fileType = archive.ar; 467 | path = libRCTImage.a; 468 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 469 | sourceTree = BUILT_PRODUCTS_DIR; 470 | }; 471 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 472 | isa = PBXReferenceProxy; 473 | fileType = archive.ar; 474 | path = libRCTNetwork.a; 475 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 476 | sourceTree = BUILT_PRODUCTS_DIR; 477 | }; 478 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 479 | isa = PBXReferenceProxy; 480 | fileType = archive.ar; 481 | path = libRCTVibration.a; 482 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 483 | sourceTree = BUILT_PRODUCTS_DIR; 484 | }; 485 | 146834041AC3E56700842450 /* libReact.a */ = { 486 | isa = PBXReferenceProxy; 487 | fileType = archive.ar; 488 | path = libReact.a; 489 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 490 | sourceTree = BUILT_PRODUCTS_DIR; 491 | }; 492 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 493 | isa = PBXReferenceProxy; 494 | fileType = archive.ar; 495 | path = libRCTLinking.a; 496 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 497 | sourceTree = BUILT_PRODUCTS_DIR; 498 | }; 499 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 500 | isa = PBXReferenceProxy; 501 | fileType = archive.ar; 502 | path = libRCTText.a; 503 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 504 | sourceTree = BUILT_PRODUCTS_DIR; 505 | }; 506 | /* End PBXReferenceProxy section */ 507 | 508 | /* Begin PBXResourcesBuildPhase section */ 509 | 00E356EC1AD99517003FC87E /* Resources */ = { 510 | isa = PBXResourcesBuildPhase; 511 | buildActionMask = 2147483647; 512 | files = ( 513 | ); 514 | runOnlyForDeploymentPostprocessing = 0; 515 | }; 516 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 517 | isa = PBXResourcesBuildPhase; 518 | buildActionMask = 2147483647; 519 | files = ( 520 | 008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */, 521 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 522 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 523 | ); 524 | runOnlyForDeploymentPostprocessing = 0; 525 | }; 526 | /* End PBXResourcesBuildPhase section */ 527 | 528 | /* Begin PBXSourcesBuildPhase section */ 529 | 00E356EA1AD99517003FC87E /* Sources */ = { 530 | isa = PBXSourcesBuildPhase; 531 | buildActionMask = 2147483647; 532 | files = ( 533 | 00E356F31AD99517003FC87E /* ReactNativeSocialShareTests.m in Sources */, 534 | ); 535 | runOnlyForDeploymentPostprocessing = 0; 536 | }; 537 | 13B07F871A680F5B00A75B9A /* Sources */ = { 538 | isa = PBXSourcesBuildPhase; 539 | buildActionMask = 2147483647; 540 | files = ( 541 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 542 | 8D78D7851AEC2B470061970B /* KDSocialShare.m in Sources */, 543 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 544 | ); 545 | runOnlyForDeploymentPostprocessing = 0; 546 | }; 547 | /* End PBXSourcesBuildPhase section */ 548 | 549 | /* Begin PBXTargetDependency section */ 550 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 551 | isa = PBXTargetDependency; 552 | target = 13B07F861A680F5B00A75B9A /* ReactNativeSocialShare */; 553 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 554 | }; 555 | /* End PBXTargetDependency section */ 556 | 557 | /* Begin PBXVariantGroup section */ 558 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 559 | isa = PBXVariantGroup; 560 | children = ( 561 | 13B07FB21A68108700A75B9A /* Base */, 562 | ); 563 | name = LaunchScreen.xib; 564 | path = iOS; 565 | sourceTree = ""; 566 | }; 567 | /* End PBXVariantGroup section */ 568 | 569 | /* Begin XCBuildConfiguration section */ 570 | 00E356F61AD99517003FC87E /* Debug */ = { 571 | isa = XCBuildConfiguration; 572 | buildSettings = { 573 | BUNDLE_LOADER = "$(TEST_HOST)"; 574 | FRAMEWORK_SEARCH_PATHS = ( 575 | "$(SDKROOT)/Developer/Library/Frameworks", 576 | "$(inherited)", 577 | ); 578 | GCC_PREPROCESSOR_DEFINITIONS = ( 579 | "DEBUG=1", 580 | "$(inherited)", 581 | ); 582 | INFOPLIST_FILE = ReactNativeSocialShareTests/Info.plist; 583 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 584 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 585 | PRODUCT_NAME = "$(TARGET_NAME)"; 586 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeSocialShare.app/ReactNativeSocialShare"; 587 | }; 588 | name = Debug; 589 | }; 590 | 00E356F71AD99517003FC87E /* Release */ = { 591 | isa = XCBuildConfiguration; 592 | buildSettings = { 593 | BUNDLE_LOADER = "$(TEST_HOST)"; 594 | COPY_PHASE_STRIP = NO; 595 | FRAMEWORK_SEARCH_PATHS = ( 596 | "$(SDKROOT)/Developer/Library/Frameworks", 597 | "$(inherited)", 598 | ); 599 | INFOPLIST_FILE = ReactNativeSocialShareTests/Info.plist; 600 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 601 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 602 | PRODUCT_NAME = "$(TARGET_NAME)"; 603 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ReactNativeSocialShare.app/ReactNativeSocialShare"; 604 | }; 605 | name = Release; 606 | }; 607 | 13B07F941A680F5B00A75B9A /* Debug */ = { 608 | isa = XCBuildConfiguration; 609 | buildSettings = { 610 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 611 | CODE_SIGN_IDENTITY = "iPhone Developer"; 612 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 613 | HEADER_SEARCH_PATHS = ( 614 | "$(inherited)", 615 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 616 | "$(SRCROOT)/node_modules/react-native/React/**", 617 | ); 618 | INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; 619 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 620 | OTHER_LDFLAGS = "-ObjC"; 621 | PRODUCT_NAME = ReactNativeSocialShare; 622 | PROVISIONING_PROFILE = ""; 623 | }; 624 | name = Debug; 625 | }; 626 | 13B07F951A680F5B00A75B9A /* Release */ = { 627 | isa = XCBuildConfiguration; 628 | buildSettings = { 629 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 630 | CODE_SIGN_IDENTITY = "iPhone Developer"; 631 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 632 | HEADER_SEARCH_PATHS = ( 633 | "$(inherited)", 634 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 635 | "$(SRCROOT)/node_modules/react-native/React/**", 636 | ); 637 | INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; 638 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 639 | OTHER_LDFLAGS = "-ObjC"; 640 | PRODUCT_NAME = ReactNativeSocialShare; 641 | PROVISIONING_PROFILE = ""; 642 | }; 643 | name = Release; 644 | }; 645 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 646 | isa = XCBuildConfiguration; 647 | buildSettings = { 648 | ALWAYS_SEARCH_USER_PATHS = NO; 649 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 650 | CLANG_CXX_LIBRARY = "libc++"; 651 | CLANG_ENABLE_MODULES = YES; 652 | CLANG_ENABLE_OBJC_ARC = YES; 653 | CLANG_WARN_BOOL_CONVERSION = YES; 654 | CLANG_WARN_CONSTANT_CONVERSION = YES; 655 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 656 | CLANG_WARN_EMPTY_BODY = YES; 657 | CLANG_WARN_ENUM_CONVERSION = YES; 658 | CLANG_WARN_INT_CONVERSION = YES; 659 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 660 | CLANG_WARN_UNREACHABLE_CODE = YES; 661 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 662 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 663 | COPY_PHASE_STRIP = NO; 664 | ENABLE_STRICT_OBJC_MSGSEND = YES; 665 | GCC_C_LANGUAGE_STANDARD = gnu99; 666 | GCC_DYNAMIC_NO_PIC = NO; 667 | GCC_OPTIMIZATION_LEVEL = 0; 668 | GCC_PREPROCESSOR_DEFINITIONS = ( 669 | "DEBUG=1", 670 | "$(inherited)", 671 | ); 672 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 673 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 674 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 675 | GCC_WARN_UNDECLARED_SELECTOR = YES; 676 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 677 | GCC_WARN_UNUSED_FUNCTION = YES; 678 | GCC_WARN_UNUSED_VARIABLE = YES; 679 | HEADER_SEARCH_PATHS = ( 680 | "$(inherited)", 681 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 682 | "$(SRCROOT)/node_modules/react-native/React/**", 683 | ); 684 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 685 | MTL_ENABLE_DEBUG_INFO = YES; 686 | ONLY_ACTIVE_ARCH = YES; 687 | SDKROOT = iphoneos; 688 | }; 689 | name = Debug; 690 | }; 691 | 83CBBA211A601CBA00E9B192 /* Release */ = { 692 | isa = XCBuildConfiguration; 693 | buildSettings = { 694 | ALWAYS_SEARCH_USER_PATHS = NO; 695 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 696 | CLANG_CXX_LIBRARY = "libc++"; 697 | CLANG_ENABLE_MODULES = YES; 698 | CLANG_ENABLE_OBJC_ARC = YES; 699 | CLANG_WARN_BOOL_CONVERSION = YES; 700 | CLANG_WARN_CONSTANT_CONVERSION = YES; 701 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 702 | CLANG_WARN_EMPTY_BODY = YES; 703 | CLANG_WARN_ENUM_CONVERSION = YES; 704 | CLANG_WARN_INT_CONVERSION = YES; 705 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 706 | CLANG_WARN_UNREACHABLE_CODE = YES; 707 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 708 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 709 | COPY_PHASE_STRIP = YES; 710 | ENABLE_NS_ASSERTIONS = NO; 711 | ENABLE_STRICT_OBJC_MSGSEND = YES; 712 | GCC_C_LANGUAGE_STANDARD = gnu99; 713 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 714 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 715 | GCC_WARN_UNDECLARED_SELECTOR = YES; 716 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 717 | GCC_WARN_UNUSED_FUNCTION = YES; 718 | GCC_WARN_UNUSED_VARIABLE = YES; 719 | HEADER_SEARCH_PATHS = ( 720 | "$(inherited)", 721 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 722 | "$(SRCROOT)/node_modules/react-native/React/**", 723 | ); 724 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 725 | MTL_ENABLE_DEBUG_INFO = NO; 726 | SDKROOT = iphoneos; 727 | VALIDATE_PRODUCT = YES; 728 | }; 729 | name = Release; 730 | }; 731 | /* End XCBuildConfiguration section */ 732 | 733 | /* Begin XCConfigurationList section */ 734 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ReactNativeSocialShareTests" */ = { 735 | isa = XCConfigurationList; 736 | buildConfigurations = ( 737 | 00E356F61AD99517003FC87E /* Debug */, 738 | 00E356F71AD99517003FC87E /* Release */, 739 | ); 740 | defaultConfigurationIsVisible = 0; 741 | defaultConfigurationName = Release; 742 | }; 743 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ReactNativeSocialShare" */ = { 744 | isa = XCConfigurationList; 745 | buildConfigurations = ( 746 | 13B07F941A680F5B00A75B9A /* Debug */, 747 | 13B07F951A680F5B00A75B9A /* Release */, 748 | ); 749 | defaultConfigurationIsVisible = 0; 750 | defaultConfigurationName = Release; 751 | }; 752 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ReactNativeSocialShare" */ = { 753 | isa = XCConfigurationList; 754 | buildConfigurations = ( 755 | 83CBBA201A601CBA00E9B192 /* Debug */, 756 | 83CBBA211A601CBA00E9B192 /* Release */, 757 | ); 758 | defaultConfigurationIsVisible = 0; 759 | defaultConfigurationName = Release; 760 | }; 761 | /* End XCConfigurationList section */ 762 | }; 763 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 764 | } 765 | -------------------------------------------------------------------------------- /ReactNativeSocialShare.xcodeproj/xcshareddata/xcschemes/ReactNativeSocialShare.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /ReactNativeSocialShareTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ReactNativeSocialShareTests/ReactNativeSocialShareTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTAssert.h" 14 | #import "RCTRedBox.h" 15 | #import "RCTRootView.h" 16 | 17 | #define TIMEOUT_SECONDS 240 18 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 19 | 20 | @interface ReactNativeSocialShareTests : XCTestCase 21 | 22 | @end 23 | 24 | @implementation ReactNativeSocialShareTests 25 | 26 | 27 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 28 | { 29 | if (test(view)) { 30 | return YES; 31 | } 32 | for (UIView *subview in [view subviews]) { 33 | if ([self findSubviewInView:subview matching:test]) { 34 | return YES; 35 | } 36 | } 37 | return NO; 38 | } 39 | 40 | - (void)testRendersWelcomeScreen { 41 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 42 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 43 | BOOL foundElement = NO; 44 | NSString *redboxError = nil; 45 | 46 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 47 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:date]; 48 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:date]; 49 | 50 | redboxError = [[RCTRedBox sharedInstance] currentErrorMessage]; 51 | 52 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 53 | if ([view respondsToSelector:@selector(attributedText)]) { 54 | NSString *text = [(id)view attributedText].string; 55 | if ([text isEqualToString:TEXT_TO_LOOK_FOR]) { 56 | return YES; 57 | } 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Cound't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | def _ext = rootProject.ext; 4 | def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 26; 5 | def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '26.0.3'; 6 | def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16; 7 | def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 26; 8 | 9 | android { 10 | compileSdkVersion _compileSdkVersion 11 | buildToolsVersion _buildToolsVersion 12 | 13 | defaultConfig { 14 | minSdkVersion _minSdkVersion 15 | targetSdkVersion _targetSdkVersion 16 | versionCode 2 17 | versionName "1.1" 18 | ndk { 19 | abiFilters "armeabi-v7a", "x86" 20 | } 21 | } 22 | lintOptions { 23 | warning 'InvalidPackage' 24 | } 25 | } 26 | 27 | dependencies { 28 | implementation 'com.facebook.react:react-native:+' 29 | } 30 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/src/main/java/com/barefootcoders/android/react/KDSocialShare/KDSocialShare.java: -------------------------------------------------------------------------------- 1 | package com.barefootcoders.android.react.KDSocialShare; 2 | 3 | import android.app.Activity; 4 | 5 | import com.facebook.react.ReactPackage; 6 | import com.facebook.react.bridge.JavaScriptModule; 7 | import com.facebook.react.bridge.NativeModule; 8 | import com.facebook.react.bridge.ReactApplicationContext; 9 | import com.facebook.react.uimanager.ViewManager; 10 | 11 | import java.util.Arrays; 12 | import java.util.Collections; 13 | import java.util.List; 14 | 15 | public class KDSocialShare implements ReactPackage { 16 | public KDSocialShare(Activity activity) { 17 | } // backwards compatability 18 | 19 | public KDSocialShare() { 20 | } 21 | 22 | @Override 23 | public List createNativeModules(ReactApplicationContext reactContext) { 24 | return Arrays.asList(new KDSocialShareModule(reactContext)); 25 | } 26 | 27 | @Override 28 | public List createViewManagers(ReactApplicationContext reactContext) { 29 | return Collections.emptyList(); 30 | } 31 | 32 | // Deprecated from RN 0.47.0 33 | public List> createJSModules() { 34 | return Collections.emptyList(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /android/src/main/java/com/barefootcoders/android/react/KDSocialShare/KDSocialShareModule.java: -------------------------------------------------------------------------------- 1 | package com.barefootcoders.android.react.KDSocialShare; 2 | 3 | import android.content.Intent; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager; 6 | import android.content.pm.ResolveInfo; 7 | import android.net.Uri; 8 | import android.os.Build; 9 | 10 | import com.facebook.react.bridge.ReactApplicationContext; 11 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 12 | import com.facebook.react.bridge.ReactMethod; 13 | import com.facebook.react.bridge.ReadableMap; 14 | import com.facebook.react.bridge.ReadableArray; 15 | import com.facebook.react.bridge.Callback; 16 | 17 | import java.util.List; 18 | import java.io.File; 19 | 20 | public class KDSocialShareModule extends ReactContextBaseJavaModule { 21 | ReactApplicationContext reactContext; 22 | 23 | public KDSocialShareModule(ReactApplicationContext reactContext) { 24 | super(reactContext); 25 | this.reactContext = reactContext; 26 | } 27 | 28 | @Override 29 | public String getName() { 30 | return "KDSocialShare"; 31 | } 32 | 33 | @ReactMethod 34 | public void tweet(ReadableMap options, Callback callback) { 35 | try { 36 | String shareText = options.getString("text"); 37 | 38 | if (doesPackageExist("com.twitter.android")) { 39 | try { 40 | tweetViaTwitterComposerClass(shareText); 41 | } catch (Exception ex1) { 42 | try { 43 | tweetViaTwitterDefaultClass(shareText); 44 | } catch (Exception ex2) { 45 | tweetViaWebPopup(shareText); 46 | } 47 | } 48 | } else { 49 | tweetViaWebPopup(shareText); 50 | } 51 | } catch (Exception ex) { 52 | callback.invoke("error"); 53 | } 54 | } 55 | 56 | @ReactMethod 57 | public void shareOnFacebook(ReadableMap options, Callback callback) { 58 | try { 59 | Intent shareIntent; 60 | 61 | if (options.hasKey("text") && doesPackageExist("com.facebook.katana")) { 62 | String shareText = options.getString("text"); 63 | shareIntent = new Intent(Intent.ACTION_SEND); 64 | shareIntent.setType("text/plain"); 65 | shareIntent.putExtra(Intent.EXTRA_TEXT, shareText); 66 | if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M || Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { 67 | shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 68 | } 69 | } else if (options.hasKey("link")) { 70 | String shareUrl = options.getString("link"); 71 | String sharerUrl = "https://www.facebook.com/sharer/sharer.php?u=" + Uri.encode(shareUrl); 72 | shareIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(sharerUrl)); 73 | if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M || Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { 74 | shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 75 | } 76 | } else { 77 | if (options.hasKey("text") && !doesPackageExist("com.facebook.katana")) { 78 | callback.invoke("error", "If text is provided to Facebook sharing, the application must be installed"); 79 | } else { 80 | callback.invoke("error"); 81 | } 82 | return; 83 | } 84 | 85 | reactContext.startActivity(shareIntent); 86 | } catch (Exception ex) { 87 | callback.invoke("error"); 88 | } 89 | } 90 | 91 | private boolean doesPackageExist(String targetPackage) { 92 | PackageManager pm = this.reactContext.getPackageManager(); 93 | try { 94 | PackageInfo info = pm.getPackageInfo( 95 | targetPackage, 96 | PackageManager.GET_META_DATA 97 | ); 98 | } catch (PackageManager.NameNotFoundException e) { 99 | return false; 100 | } 101 | return true; 102 | } 103 | 104 | private void tweetViaTwitterComposerClass(String shareText) throws Exception { 105 | Intent shareIntent = new Intent(Intent.ACTION_SEND); 106 | shareIntent.setClassName("com.twitter.android", "com.twitter.android.composer.ComposerActivity"); 107 | shareIntent.setType("text/*"); 108 | shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareText); 109 | shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 110 | reactContext.startActivity(shareIntent); 111 | } 112 | 113 | private void tweetViaTwitterDefaultClass(String shareText) throws Exception { 114 | Intent shareIntent = new Intent(Intent.ACTION_SEND); 115 | shareIntent.setPackage("com.twitter.android"); 116 | shareIntent.setType("text/*"); 117 | shareIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareText); 118 | shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 119 | reactContext.startActivity(shareIntent); 120 | } 121 | 122 | private void tweetViaWebPopup(String shareText) throws Exception { 123 | String tweetUrl = "https://twitter.com/intent/tweet?text=" + Uri.encode(shareText); 124 | Uri uri = Uri.parse(tweetUrl); 125 | Intent shareIntent = new Intent(Intent.ACTION_VIEW, uri); 126 | shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 127 | reactContext.startActivity(shareIntent); 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /assets/animation-looping.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doefler/react-native-social-share/cd07a5568074364d9a6ae5d1fbeddf03f7caccb0/assets/animation-looping.gif -------------------------------------------------------------------------------- /assets/animation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doefler/react-native-social-share/cd07a5568074364d9a6ae5d1fbeddf03f7caccb0/assets/animation.gif -------------------------------------------------------------------------------- /assets/still.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/doefler/react-native-social-share/cd07a5568074364d9a6ae5d1fbeddf03f7caccb0/assets/still.png -------------------------------------------------------------------------------- /iOS/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /iOS/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | NSURL *jsCodeLocation; 19 | 20 | // Loading JavaScript code - uncomment the one you want. 21 | 22 | // OPTION 1 23 | // Load from development server. Start the server from the repository root: 24 | // 25 | // $ npm start 26 | // 27 | // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and 28 | // iOS device are on the same Wi-Fi network. 29 | //jsCodeLocation = [NSURL URLWithString:@"http://localhost:8091/index.ios.bundle"]; 30 | 31 | // OPTION 2 32 | // Load from pre-bundled file on disk. To re-generate the static bundle, run 33 | // 34 | // $ curl 'http://localhost:8091/index.ios.bundle?dev=false&minify=true' -o iOS/main.jsbundle 35 | // 36 | // and uncomment the next following line 37 | jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 38 | 39 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 40 | moduleName:@"ReactNativeSocialShare" 41 | launchOptions:launchOptions]; 42 | 43 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 44 | UIViewController *rootViewController = [[UIViewController alloc] init]; 45 | rootViewController.view = rootView; 46 | self.window.rootViewController = rootViewController; 47 | [self.window makeKeyAndVisible]; 48 | return YES; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /iOS/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /iOS/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /iOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /iOS/KDSocialShare.h: -------------------------------------------------------------------------------- 1 | // 2 | // KDSocialShare.h 3 | // ReactNativeSocialShare 4 | // 5 | // Created by Kim Døfler Sand Laursen on 25-04-15. 6 | // Copyright (c) 2015 Facebook. All rights reserved. 7 | // 8 | @import UIKit; 9 | 10 | #import 11 | 12 | @interface KDSocialShare : NSObject 13 | @end 14 | -------------------------------------------------------------------------------- /iOS/KDSocialShare.m: -------------------------------------------------------------------------------- 1 | // 2 | // KDSocialShare.m 3 | // ReactNativeSocialShare 4 | // 5 | // Created by Kim Døfler Sand Laursen on 25-04-15. 6 | // Copyright (c) 2015 Facebook. All rights reserved. 7 | // 8 | 9 | #import "KDSocialShare.h" 10 | #import 11 | #import 12 | 13 | @implementation KDSocialShare 14 | 15 | // Expose this module to the React Native bridge 16 | RCT_EXPORT_MODULE() 17 | 18 | - (dispatch_queue_t)methodQueue 19 | { 20 | return dispatch_get_main_queue(); 21 | } 22 | 23 | -(void)share:(NSString *)serviceType 24 | options:(NSDictionary *)options 25 | callback:(RCTResponseSenderBlock)callback 26 | { 27 | SLComposeViewController *composeCtl = [SLComposeViewController composeViewControllerForServiceType:serviceType]; 28 | 29 | if ([options objectForKey:@"link"] && [options objectForKey:@"link"] != [NSNull null]) { 30 | NSString *link = [RCTConvert NSString:options[@"link"]]; 31 | [composeCtl addURL:[NSURL URLWithString:link]]; 32 | } 33 | 34 | if ([options objectForKey:@"image"] && [options objectForKey:@"image"] != [NSNull null]) { 35 | [composeCtl addImage: [UIImage imageNamed: options[@"image"]]]; 36 | } else if ([options objectForKey:@"imagelink"] && [options objectForKey:@"imagelink"] != [NSNull null]) { 37 | NSString *imagelink = [RCTConvert NSString:options[@"imagelink"]]; 38 | UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:imagelink]]]; 39 | [composeCtl addImage:image]; 40 | } 41 | 42 | if ([options objectForKey:@"text"] && [options objectForKey:@"text"] != [NSNull null]) { 43 | NSString *text = [RCTConvert NSString:options[@"text"]]; 44 | [composeCtl setInitialText:text]; 45 | } 46 | 47 | [composeCtl setCompletionHandler:^(SLComposeViewControllerResult result) { 48 | if (result == SLComposeViewControllerResultDone) { 49 | // Sent 50 | callback(@[@"success"]); 51 | } 52 | else if (result == SLComposeViewControllerResultCancelled){ 53 | // Cancelled 54 | callback(@[@"cancelled"]); 55 | } 56 | }]; 57 | 58 | UIViewController *ctrl = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 59 | [ctrl presentViewController:composeCtl animated:YES completion: nil]; 60 | } 61 | 62 | RCT_EXPORT_METHOD(shareOnFacebook:(NSDictionary *)options 63 | callback: (RCTResponseSenderBlock)callback) 64 | { 65 | NSURL *url = [NSURL URLWithString:@"fb://"]; 66 | if ([[UIApplication sharedApplication] canOpenURL:url]) { 67 | [self share:SLServiceTypeFacebook options:options callback: callback]; 68 | } else { 69 | callback(@[@"not_available"]); 70 | } 71 | } 72 | 73 | RCT_EXPORT_METHOD(tweet:(NSDictionary *)options 74 | callback: (RCTResponseSenderBlock)callback) 75 | { 76 | NSURL *url = [NSURL URLWithString:@"twitter://"]; 77 | if ([[UIApplication sharedApplication] canOpenURL:url]) { 78 | [self share:SLServiceTypeTwitter options:options callback: callback]; 79 | } else { 80 | callback(@[@"not_available"]); 81 | } 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /iOS/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-social-share", 3 | "version": "1.6.5", 4 | "description": "Use the iOS native Twitter and Facebook share view from react native", 5 | "author": { 6 | "name": "Kim Døfler", 7 | "email": "kim.doefler@gmail.com" 8 | }, 9 | "keywords": [ 10 | "react", 11 | "twitter", 12 | "facebook", 13 | "SLComposeViewController", 14 | "RCTBridgeModule", 15 | "Social", 16 | "react-native", 17 | "react-component", 18 | "react-native-component", 19 | "mobile", 20 | "ui", 21 | "react native facebook", 22 | "react native twitter" 23 | ], 24 | "homepage": "https://github.com/doefler/react-native-social-share", 25 | "bugs": { 26 | "url": "https://github.com/doefler/react-native-social-share/issues" 27 | }, 28 | "repository": { 29 | "type": "git", 30 | "url": "git://github.com/doefler/react-native-social-share.git" 31 | }, 32 | "scripts": { 33 | "release": "release-it -n" 34 | }, 35 | "_npmUser": { 36 | "name": "doefler", 37 | "email": "kim.doefler@gmail.com" 38 | }, 39 | "maintainers": [ 40 | { 41 | "name": "Kim Døfler", 42 | "email": "kim.doefler@gmail.com" 43 | } 44 | ], 45 | "license": "MIT", 46 | "main": "react-native-social-share.js" 47 | } 48 | -------------------------------------------------------------------------------- /react-native-social-share.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @providesModule react-native-social-share 3 | */ 4 | 5 | var KDSocialShare = require('react-native').NativeModules.KDSocialShare; 6 | 7 | module.exports = { 8 | shareOnTwitter: function(params, callback) { 9 | if (!(params['link'] || params['text'])) { 10 | callback("missing_link_or_text"); 11 | } else { 12 | return KDSocialShare.tweet(params, callback); 13 | } 14 | }, 15 | shareOnFacebook: function(params, callback) { 16 | if (!(params['link'] || params['text'])) { 17 | callback("missing_link_or_text"); 18 | } else { 19 | return KDSocialShare.shareOnFacebook(params, callback); 20 | } 21 | } 22 | }; 23 | --------------------------------------------------------------------------------