File tree Expand file tree Collapse file tree
chapter-13/ios-specific/InvokeFromNative
InvokeFromNative.xcodeproj Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,20 +14,24 @@ import {
1414} from 'react-native' ;
1515
1616class InvokeFromNative extends Component {
17+ state = {
18+ status : 'App Running'
19+ }
20+
1721 componentWillMount ( ) {
18- this . setState ( {
19- status : 'App Running'
20- } ) ;
2122 Linking . addEventListener ( 'url' , this . onAppInvoked ) ;
2223 }
24+
2325 componentWillUnmount ( ) {
24- Linking . removeEventListener ( 'url' , this . onAppInvoked ) ;
26+ Linking . removeEventListener ( 'url' , this . onAppInvoked ) ;
2527 }
28+
2629 onAppInvoked = ( event ) => {
2730 this . setState ( {
28- status : `App Invoked by ${ event . url } `
31+ status : `App Invoked by ${ event . url } `
2932 } ) ;
3033 }
34+
3135 render ( ) {
3236 return (
3337 < View style = { styles . container } >
Original file line number Diff line number Diff line change 12081208 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12091209 CURRENT_PROJECT_VERSION = 1;
12101210 DEAD_CODE_STRIPPING = NO;
1211+ HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/Libraries/**";
12111212 INFOPLIST_FILE = InvokeFromNative/Info.plist;
12121213 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
12131214 OTHER_LDFLAGS = (
12261227 buildSettings = {
12271228 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
12281229 CURRENT_PROJECT_VERSION = 1;
1230+ HEADER_SEARCH_PATHS = "$(SRCROOT)/../node_modules/react-native/Libraries/**";
12291231 INFOPLIST_FILE = InvokeFromNative/Info.plist;
12301232 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
12311233 OTHER_LDFLAGS = (
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3434 return YES ;
3535}
3636
37- - (BOOL )application : (UIApplication *)application openURL : (NSURL *)url
38- sourceApplication : (NSString *)sourceApplication annotation : (id )annotation
37+ - (BOOL )application : (UIApplication *)application
38+ openURL : (NSURL *)url
39+ options : (NSDictionary <UIApplicationOpenURLOptionsKey,id> *)options
3940{
40- return [RCTLinkingManager application: application openURL: url
41- sourceApplication: sourceApplication annotation: annotation];
41+ return [RCTLinkingManager application: application openURL: url options: options];
4242}
4343
4444@end
You can’t perform that action at this time.
0 commit comments