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 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
#import <UIKit/UIKit.h> |
|
21 |
|
|
22 |
#import "FBSDKAppLinkReturnToRefererView.h" |
|
23 |
|
|
24 |
NS_ASSUME_NONNULL_BEGIN |
|
25 |
|
|
26 |
@class FBSDKAppLink; |
|
27 |
@class FBSDKAppLinkReturnToRefererController; |
|
28 |
|
88188e
|
29 |
/** |
13e53a
|
30 |
Protocol that a class can implement in order to be notified when the user has navigated back |
H |
31 |
to the referer of an App Link. |
|
32 |
*/ |
e81c27
|
33 |
NS_SWIFT_NAME(AppLinkReturnToRefererControllerDelegate) |
13e53a
|
34 |
@protocol FBSDKAppLinkReturnToRefererControllerDelegate <NSObject> |
H |
35 |
|
|
36 |
@optional |
|
37 |
|
88188e
|
38 |
/** Called when the user has tapped to navigate, but before the navigation has been performed. */ |
13e53a
|
39 |
- (void)returnToRefererController:(FBSDKAppLinkReturnToRefererController *)controller |
e81c27
|
40 |
willNavigateToAppLink:(FBSDKAppLink *)appLink |
H |
41 |
NS_SWIFT_NAME(return(to:willNavigateTo:)); |
13e53a
|
42 |
|
88188e
|
43 |
/** Called after the navigation has been attempted, with an indication of whether the referer |
13e53a
|
44 |
app link was successfully opened. */ |
H |
45 |
- (void)returnToRefererController:(FBSDKAppLinkReturnToRefererController *)controller |
|
46 |
didNavigateToAppLink:(FBSDKAppLink *)url |
e81c27
|
47 |
type:(FBSDKAppLinkNavigationType)type |
H |
48 |
NS_SWIFT_NAME(return(to:didNavigateTo:type:)); |
13e53a
|
49 |
|
H |
50 |
@end |
|
51 |
|
88188e
|
52 |
/** |
13e53a
|
53 |
A controller class that implements default behavior for a FBSDKAppLinkReturnToRefererView, including |
H |
54 |
the ability to display the view above the navigation bar for navigation-based apps. |
|
55 |
*/ |
|
56 |
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension") |
e81c27
|
57 |
NS_SWIFT_NAME(AppLinkReturnToRefererController) |
13e53a
|
58 |
@interface FBSDKAppLinkReturnToRefererController : NSObject <FBSDKAppLinkReturnToRefererViewDelegate> |
H |
59 |
|
88188e
|
60 |
/** |
13e53a
|
61 |
The delegate that will be notified when the user navigates back to the referer. |
H |
62 |
*/ |
|
63 |
@property (nonatomic, weak, nullable) id<FBSDKAppLinkReturnToRefererControllerDelegate> delegate; |
|
64 |
|
88188e
|
65 |
/** |
13e53a
|
66 |
The FBSDKAppLinkReturnToRefererView this controller is controlling. |
H |
67 |
*/ |
|
68 |
@property (nonatomic, strong) FBSDKAppLinkReturnToRefererView *view; |
|
69 |
|
88188e
|
70 |
/** |
13e53a
|
71 |
Initializes a controller suitable for controlling a FBSDKAppLinkReturnToRefererView that is to be displayed |
H |
72 |
contained within another UIView (i.e., not displayed above the navigation bar). |
|
73 |
*/ |
|
74 |
- (instancetype)init NS_DESIGNATED_INITIALIZER; |
|
75 |
|
88188e
|
76 |
/** |
13e53a
|
77 |
Initializes a controller suitable for controlling a FBSDKAppLinkReturnToRefererView that is to be displayed |
H |
78 |
displayed above the navigation bar. |
e81c27
|
79 |
|
H |
80 |
@param navController The Navigation Controller for display above |
13e53a
|
81 |
*/ |
e81c27
|
82 |
- (instancetype)initForDisplayAboveNavController:(UINavigationController *)navController |
H |
83 |
NS_SWIFT_NAME(init(navController:)); |
13e53a
|
84 |
|
88188e
|
85 |
/** |
13e53a
|
86 |
Removes the view entirely from the navigation controller it is currently displayed in. |
H |
87 |
*/ |
|
88 |
- (void)removeFromNavController; |
|
89 |
|
88188e
|
90 |
/** |
13e53a
|
91 |
Shows the FBSDKAppLinkReturnToRefererView with the specified referer information. If nil or missing data, |
H |
92 |
the view will not be displayed. */ |
e81c27
|
93 |
- (void)showViewForRefererAppLink:(FBSDKAppLink *)refererAppLink |
H |
94 |
NS_SWIFT_NAME(showView(forReferer:)); |
13e53a
|
95 |
|
88188e
|
96 |
/** |
13e53a
|
97 |
Shows the FBSDKAppLinkReturnToRefererView with referer information extracted from the specified URL. |
H |
98 |
If nil or missing referer App Link data, the view will not be displayed. */ |
e81c27
|
99 |
- (void)showViewForRefererURL:(NSURL *)url |
H |
100 |
NS_SWIFT_NAME(showView(forReferer:)); |
13e53a
|
101 |
|
88188e
|
102 |
/** |
13e53a
|
103 |
Closes the view, possibly animating it. |
H |
104 |
*/ |
|
105 |
- (void)closeViewAnimated:(BOOL)animated; |
|
106 |
|
|
107 |
@end |
|
108 |
|
|
109 |
NS_ASSUME_NONNULL_END |