diff --git a/ActivityView.h b/ActivityView.h index b699194..c27f9a1 100644 --- a/ActivityView.h +++ b/ActivityView.h @@ -1,4 +1,4 @@ -#import "RCTBridgeModule.h" +#import @import UIKit; diff --git a/ActivityView.m b/ActivityView.m index ffb15ed..2638ebe 100644 --- a/ActivityView.m +++ b/ActivityView.m @@ -1,8 +1,8 @@ #import "ActivityView.h" -#import "RCTLog.h" -#import "RCTBridge.h" -#import "RCTUIManager.h" -#import "RCTImageLoader.h" +#import +#import +#import +#import @implementation ActivityView @@ -74,24 +74,18 @@ - (NSArray*)excludedActivitiesForKeys:(NSArray*)passedKeys { return [self showWithOptions:args image:shareImage]; } - RCTImageLoader *loader = (RCTImageLoader*)[self.bridge moduleForClass:[RCTImageLoader class]]; __weak ActivityView *weakSelf = self; - [loader loadImageWithURLRequest:imageUrl callback:^(NSError *error, id imageOrData) { + [self.bridge.imageLoader loadImageWithURLRequest: [RCTConvert NSURLRequest: imageUrl] + callback:^(NSError *error, UIImage *image) { if (!error) { - if ([imageOrData isKindOfClass:[NSData class]]) { - shareImage = [UIImage imageWithData:imageOrData]; - } else { - shareImage = imageOrData; - } + dispatch_async([weakSelf methodQueue], ^{ + [weakSelf showWithOptions:args image:image]; + }); } else { RCTLogWarn(@"[ActivityView] Could not fetch image."); } - - dispatch_async([weakSelf methodQueue], ^{ - [weakSelf showWithOptions:args image:shareImage]; - }); }]; } diff --git a/examples/ActivityViewExample/index.ios.js b/examples/ActivityViewExample/index.ios.js index 89e4a6c..1433cdc 100644 --- a/examples/ActivityViewExample/index.ios.js +++ b/examples/ActivityViewExample/index.ios.js @@ -1,7 +1,7 @@ 'use strict'; -import React, { +import React, { Component } from 'react'; +import { AppRegistry, - Component, StyleSheet, Text, TouchableHighlight, diff --git a/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/project.pbxproj b/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/project.pbxproj index 0ba7674..11c7e8d 100644 --- a/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/project.pbxproj +++ b/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/project.pbxproj @@ -89,6 +89,97 @@ remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; remoteInfo = React; }; + 5DAFC3D31E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A283A1D9B042B00D4039D; + remoteInfo = "RCTImage-tvOS"; + }; + 5DAFC3D71E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28471D9B043800D4039D; + remoteInfo = "RCTLinking-tvOS"; + }; + 5DAFC3DB1E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28541D9B044C00D4039D; + remoteInfo = "RCTNetwork-tvOS"; + }; + 5DAFC3DF1E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28611D9B046600D4039D; + remoteInfo = "RCTSettings-tvOS"; + }; + 5DAFC3E31E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A287B1D9B048500D4039D; + remoteInfo = "RCTText-tvOS"; + }; + 5DAFC3E81E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28881D9B049200D4039D; + remoteInfo = "RCTWebSocket-tvOS"; + }; + 5DAFC3F21E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 2D2A28131D9B038B00D4039D; + remoteInfo = "React-tvOS"; + }; + 5DAFC3F41E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3C059A1DE3340900C268FA; + remoteInfo = yoga; + }; + 5DAFC3F61E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3C06751DE3340C00C268FA; + remoteInfo = "yoga-tvOS"; + }; + 5DAFC3F81E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4; + remoteInfo = cxxreact; + }; + 5DAFC3FA1E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4; + remoteInfo = "cxxreact-tvOS"; + }; + 5DAFC3FC1E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4; + remoteInfo = jschelpers; + }; + 5DAFC3FE1E82D499007CA362 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4; + remoteInfo = "jschelpers-tvOS"; + }; 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; @@ -186,6 +277,7 @@ isa = PBXGroup; children = ( 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, + 5DAFC3D41E82D499007CA362 /* libRCTImage-tvOS.a */, ); name = Products; sourceTree = ""; @@ -194,6 +286,7 @@ isa = PBXGroup; children = ( 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, + 5DAFC3DC1E82D499007CA362 /* libRCTNetwork-tvOS.a */, ); name = Products; sourceTree = ""; @@ -227,6 +320,7 @@ isa = PBXGroup; children = ( 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, + 5DAFC3E01E82D499007CA362 /* libRCTSettings-tvOS.a */, ); name = Products; sourceTree = ""; @@ -235,6 +329,7 @@ isa = PBXGroup; children = ( 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, + 5DAFC3E91E82D499007CA362 /* libRCTWebSocket-tvOS.a */, ); name = Products; sourceTree = ""; @@ -257,6 +352,13 @@ isa = PBXGroup; children = ( 146834041AC3E56700842450 /* libReact.a */, + 5DAFC3F31E82D499007CA362 /* libReact.a */, + 5DAFC3F51E82D499007CA362 /* libyoga.a */, + 5DAFC3F71E82D499007CA362 /* libyoga.a */, + 5DAFC3F91E82D499007CA362 /* libcxxreact.a */, + 5DAFC3FB1E82D499007CA362 /* libcxxreact.a */, + 5DAFC3FD1E82D499007CA362 /* libjschelpers.a */, + 5DAFC3FF1E82D499007CA362 /* libjschelpers.a */, ); name = Products; sourceTree = ""; @@ -265,6 +367,7 @@ isa = PBXGroup; children = ( 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, + 5DAFC3D81E82D499007CA362 /* libRCTLinking-tvOS.a */, ); name = Products; sourceTree = ""; @@ -291,6 +394,7 @@ isa = PBXGroup; children = ( 832341B51AAA6A8300B99B32 /* libRCTText.a */, + 5DAFC3E41E82D499007CA362 /* libRCTText-tvOS.a */, ); name = Products; sourceTree = ""; @@ -500,6 +604,97 @@ remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 5DAFC3D41E82D499007CA362 /* libRCTImage-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTImage-tvOS.a"; + remoteRef = 5DAFC3D31E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3D81E82D499007CA362 /* libRCTLinking-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTLinking-tvOS.a"; + remoteRef = 5DAFC3D71E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3DC1E82D499007CA362 /* libRCTNetwork-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTNetwork-tvOS.a"; + remoteRef = 5DAFC3DB1E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3E01E82D499007CA362 /* libRCTSettings-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTSettings-tvOS.a"; + remoteRef = 5DAFC3DF1E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3E41E82D499007CA362 /* libRCTText-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTText-tvOS.a"; + remoteRef = 5DAFC3E31E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3E91E82D499007CA362 /* libRCTWebSocket-tvOS.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libRCTWebSocket-tvOS.a"; + remoteRef = 5DAFC3E81E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3F31E82D499007CA362 /* libReact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libReact.a; + remoteRef = 5DAFC3F21E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3F51E82D499007CA362 /* libyoga.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libyoga.a; + remoteRef = 5DAFC3F41E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3F71E82D499007CA362 /* libyoga.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libyoga.a; + remoteRef = 5DAFC3F61E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3F91E82D499007CA362 /* libcxxreact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcxxreact.a; + remoteRef = 5DAFC3F81E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3FB1E82D499007CA362 /* libcxxreact.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libcxxreact.a; + remoteRef = 5DAFC3FA1E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3FD1E82D499007CA362 /* libjschelpers.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjschelpers.a; + remoteRef = 5DAFC3FC1E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 5DAFC3FF1E82D499007CA362 /* libjschelpers.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjschelpers.a; + remoteRef = 5DAFC3FE1E82D499007CA362 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -648,8 +843,12 @@ "$(SRCROOT)/../node_modules/react-native/React/**", ); INFOPLIST_FILE = ActivityViewExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = ActivityViewExample; }; name = Debug; @@ -664,8 +863,12 @@ "$(SRCROOT)/../node_modules/react-native/React/**", ); INFOPLIST_FILE = ActivityViewExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - OTHER_LDFLAGS = "-ObjC"; + OTHER_LDFLAGS = ( + "-ObjC", + "-lc++", + ); PRODUCT_NAME = ActivityViewExample; }; name = Release; diff --git a/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/xcshareddata/xcschemes/ActivityViewExample.xcscheme b/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/xcshareddata/xcschemes/ActivityViewExample.xcscheme index 1a9879a..70a2a95 100644 --- a/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/xcshareddata/xcschemes/ActivityViewExample.xcscheme +++ b/examples/ActivityViewExample/ios/ActivityViewExample.xcodeproj/xcshareddata/xcschemes/ActivityViewExample.xcscheme @@ -3,9 +3,23 @@ LastUpgradeVersion = "0620" version = "1.3"> + + + + + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +76,18 @@ ReferencedContainer = "container:ActivityViewExample.xcodeproj"> + + @@ -86,10 +103,10 @@ diff --git a/examples/ActivityViewExample/ios/ActivityViewExample/Images.xcassets/AppIcon.appiconset/Contents.json b/examples/ActivityViewExample/ios/ActivityViewExample/Images.xcassets/AppIcon.appiconset/Contents.json index 118c98f..b8236c6 100644 --- a/examples/ActivityViewExample/ios/ActivityViewExample/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/ActivityViewExample/ios/ActivityViewExample/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/examples/ActivityViewExample/package.json b/examples/ActivityViewExample/package.json index 8f5cd36..07514c8 100644 --- a/examples/ActivityViewExample/package.json +++ b/examples/ActivityViewExample/package.json @@ -6,7 +6,8 @@ "start": "node node_modules/react-native/local-cli/cli.js start" }, "dependencies": { - "react-native": "0.17.0", + "react": "~15.4.1", + "react-native": "^0.42.0", "react-native-activity-view": "../.." } }