1 // Copyright 2015-present 650 Industries. All rights reserved.
2 //
3 // Contains logic for figuring out how to take care of deep links.
4 
5 #import "EXLinkingManager.h"
6 #import "EXReactAppManager.h"
7 #import "EXUtil.h"
8 
9 FOUNDATION_EXPORT NSNotificationName kEXKernelRefreshForegroundTaskNotification DEPRECATED_ATTRIBUTE;
10 
11 /**
12  * Post this notification with to indicate that you want the kernel
13  * to try and open that link. Parameters in the notification may include:
14  *   url - the url to try and open.
15  */
16 FOUNDATION_EXPORT NSNotificationName kEXKernelOpenUrlNotification DEPRECATED_MSG_ATTRIBUTE("Use `openUrl`");
17 
18 @interface EXKernelLinkingManager : NSObject
19   <EXLinkingManagerScopedModuleDelegate, EXUtilScopedModuleDelegate>
20 
21 /**
22  *  Either opens the url on an existing bridge, or sends it to the kernel
23  *  for opening on a new bridge.
24  */
25 - (void)openUrl:(NSString *)urlString isUniversalLink:(BOOL)isUniversalLink;
26 
27 /**
28  *  Called by Util.reload() to rerequest the foreground tasks's manifest
29  *  and reload the bundle url it contains.
30  */
31 - (void)refreshForegroundTask;
32 
33 /**
34  *  Flagged when `refreshForegroundTask` is called. After the manifest round trip is complete,
35  *  the kernel may need to disambiguate loading a new app from refreshing the existing app.
36  */
37 - (BOOL)isRefreshExpectedForAppManager:(EXReactAppManager *)manager;
38 
39 /**
40  *  Returns the deep link prefix for a given experience uri.
41  */
42 + (NSString *)linkingUriForExperienceUri:(NSURL *)uri;
43 
44 /**
45  *  Normalize a uri and (if needed) subtitute
46  *  standalone-app-specific deep link formatting.
47  */
48 + (NSURL *)uriTransformedForLinking:(NSURL *)uri isUniversalLink:(BOOL)isUniversalLink;
49 
50 # pragma mark - app-wide linking handlers
51 
52 + (BOOL)application:(UIApplication *)application
53             openURL:(NSURL *)URL
54   sourceApplication:(NSString *)sourceApplication
55          annotation:(id)annotation;
56 
57 + (BOOL)application:(UIApplication *)application
58 continueUserActivity:(NSUserActivity *)userActivity
59  restorationHandler:(void (^)(NSArray *))restorationHandler;
60 
61 + (NSURL *)initialUrlFromLaunchOptions: (NSDictionary *)launchOptions;
62 
63 @end
64