Skip to content

Commit

Permalink
Adding LinkingIOS to example app and iOS deep linking support
Browse files Browse the repository at this point in the history
  • Loading branch information
uerceg committed Apr 24, 2017
1 parent e047600 commit 05ea980
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions example/ios/Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,7 @@
CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = QGUGW9AUMK;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS\"/**";
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
Expand All @@ -1090,6 +1091,7 @@
CODE_SIGN_ENTITLEMENTS = Example/Example.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = QGUGW9AUMK;
HEADER_SEARCH_PATHS = "\"$(SRCROOT)/../node_modules/react-native/Libraries/LinkingIOS\"/**";
INFOPLIST_FILE = Example/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
Expand Down
12 changes: 12 additions & 0 deletions example/ios/Example/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#import "AppDelegate.h"
#import "RCTLinkingManager.h"

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

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}

// Only if your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html).
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler
{
return [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}

@end

0 comments on commit 05ea980

Please sign in to comment.