commit | author | age
|
13e53a
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
H |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
49b883
|
19 |
#import "TargetConditionals.h" |
L |
20 |
|
|
21 |
#if !TARGET_OS_TV |
|
22 |
|
13e53a
|
23 |
#import <UIKit/UIKit.h> |
H |
24 |
|
|
25 |
#import "FBSDKAppLinkReturnToRefererView.h" |
|
26 |
|
|
27 |
NS_ASSUME_NONNULL_BEGIN |
|
28 |
|
|
29 |
@class FBSDKAppLink; |
|
30 |
@class FBSDKAppLinkReturnToRefererController; |
|
31 |
|
88188e
|
32 |
/** |
13e53a
|
33 |
Protocol that a class can implement in order to be notified when the user has navigated back |
H |
34 |
to the referer of an App Link. |
|
35 |
*/ |
b19a78
|
36 |
DEPRECATED_MSG_ATTRIBUTE("AppLinkReturnToRefererControllerDelegate is deprecated and will be removed in the next major release") |
e81c27
|
37 |
NS_SWIFT_NAME(AppLinkReturnToRefererControllerDelegate) |
13e53a
|
38 |
@protocol FBSDKAppLinkReturnToRefererControllerDelegate <NSObject> |
H |
39 |
|
|
40 |
@optional |
|
41 |
|
88188e
|
42 |
/** Called when the user has tapped to navigate, but before the navigation has been performed. */ |
13e53a
|
43 |
- (void)returnToRefererController:(FBSDKAppLinkReturnToRefererController *)controller |
e81c27
|
44 |
willNavigateToAppLink:(FBSDKAppLink *)appLink |
H |
45 |
NS_SWIFT_NAME(return(to:willNavigateTo:)); |
13e53a
|
46 |
|
88188e
|
47 |
/** Called after the navigation has been attempted, with an indication of whether the referer |
13e53a
|
48 |
app link was successfully opened. */ |
H |
49 |
- (void)returnToRefererController:(FBSDKAppLinkReturnToRefererController *)controller |
|
50 |
didNavigateToAppLink:(FBSDKAppLink *)url |
e81c27
|
51 |
type:(FBSDKAppLinkNavigationType)type |
H |
52 |
NS_SWIFT_NAME(return(to:didNavigateTo:type:)); |
13e53a
|
53 |
|
H |
54 |
@end |
|
55 |
|
88188e
|
56 |
/** |
13e53a
|
57 |
A controller class that implements default behavior for a FBSDKAppLinkReturnToRefererView, including |
H |
58 |
the ability to display the view above the navigation bar for navigation-based apps. |
|
59 |
*/ |
b19a78
|
60 |
DEPRECATED_MSG_ATTRIBUTE("AppLinkReturnToRefererController is deprecated and will be removed in the next major release") |
13e53a
|
61 |
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension") |
e81c27
|
62 |
NS_SWIFT_NAME(AppLinkReturnToRefererController) |
13e53a
|
63 |
@interface FBSDKAppLinkReturnToRefererController : NSObject <FBSDKAppLinkReturnToRefererViewDelegate> |
H |
64 |
|
88188e
|
65 |
/** |
13e53a
|
66 |
The delegate that will be notified when the user navigates back to the referer. |
H |
67 |
*/ |
|
68 |
@property (nonatomic, weak, nullable) id<FBSDKAppLinkReturnToRefererControllerDelegate> delegate; |
|
69 |
|
88188e
|
70 |
/** |
13e53a
|
71 |
The FBSDKAppLinkReturnToRefererView this controller is controlling. |
H |
72 |
*/ |
|
73 |
@property (nonatomic, strong) FBSDKAppLinkReturnToRefererView *view; |
|
74 |
|
88188e
|
75 |
/** |
13e53a
|
76 |
Initializes a controller suitable for controlling a FBSDKAppLinkReturnToRefererView that is to be displayed |
H |
77 |
contained within another UIView (i.e., not displayed above the navigation bar). |
|
78 |
*/ |
|
79 |
- (instancetype)init NS_DESIGNATED_INITIALIZER; |
|
80 |
|
88188e
|
81 |
/** |
13e53a
|
82 |
Initializes a controller suitable for controlling a FBSDKAppLinkReturnToRefererView that is to be displayed |
H |
83 |
displayed above the navigation bar. |
e81c27
|
84 |
|
H |
85 |
@param navController The Navigation Controller for display above |
13e53a
|
86 |
*/ |
e81c27
|
87 |
- (instancetype)initForDisplayAboveNavController:(UINavigationController *)navController |
H |
88 |
NS_SWIFT_NAME(init(navController:)); |
13e53a
|
89 |
|
88188e
|
90 |
/** |
13e53a
|
91 |
Removes the view entirely from the navigation controller it is currently displayed in. |
H |
92 |
*/ |
|
93 |
- (void)removeFromNavController; |
|
94 |
|
88188e
|
95 |
/** |
13e53a
|
96 |
Shows the FBSDKAppLinkReturnToRefererView with the specified referer information. If nil or missing data, |
H |
97 |
the view will not be displayed. */ |
e81c27
|
98 |
- (void)showViewForRefererAppLink:(FBSDKAppLink *)refererAppLink |
H |
99 |
NS_SWIFT_NAME(showView(forReferer:)); |
13e53a
|
100 |
|
88188e
|
101 |
/** |
13e53a
|
102 |
Shows the FBSDKAppLinkReturnToRefererView with referer information extracted from the specified URL. |
H |
103 |
If nil or missing referer App Link data, the view will not be displayed. */ |
e81c27
|
104 |
- (void)showViewForRefererURL:(NSURL *)url |
H |
105 |
NS_SWIFT_NAME(showView(forReferer:)); |
13e53a
|
106 |
|
88188e
|
107 |
/** |
13e53a
|
108 |
Closes the view, possibly animating it. |
H |
109 |
*/ |
|
110 |
- (void)closeViewAnimated:(BOOL)animated; |
|
111 |
|
|
112 |
@end |
|
113 |
|
|
114 |
NS_ASSUME_NONNULL_END |
49b883
|
115 |
|
L |
116 |
#endif |