Skip to content

Commit 05ea980

Browse files
committed
Adding LinkingIOS to example app and iOS deep linking support
1 parent e047600 commit 05ea980

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

example/ios/Example.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@
10701070
CURRENT_PROJECT_VERSION = 1;
10711071
DEAD_CODE_STRIPPING = NO;
10721072
DEVELOPMENT_TEAM = QGUGW9AUMK;
1073+
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS\"/**";
10731074
INFOPLIST_FILE = Example/Info.plist;
10741075
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10751076
OTHER_LDFLAGS = (
@@ -1090,6 +1091,7 @@
10901091
CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements;
10911092
CURRENT_PROJECT_VERSION = 1;
10921093
DEVELOPMENT_TEAM = QGUGW9AUMK;
1094+
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS\"/**";
10931095
INFOPLIST_FILE = Example/Info.plist;
10941096
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
10951097
OTHER_LDFLAGS = (

example/ios/Example/AppDelegate.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
#import "AppDelegate.h"
11+
#import "RCTLinkingManager.h"
1112

1213
#import <React/RCTBundleURLProvider.h>
1314
#import <React/RCTRootView.h>
@@ -34,4 +35,15 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3435
return YES;
3536
}
3637

38+
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
39+
{
40+
return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
41+
}
42+
43+
// Only if your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
44+
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
45+
{
46+
return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
47+
}
48+
3749
@end

0 commit comments

Comments
 (0)