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 |
|
|
29 |
/*! |
|
30 |
Protocol that a class can implement in order to be notified when the user has navigated back |
|
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 |
|
|
38 |
/*! Called when the user has tapped to navigate, but before the navigation has been performed. */ |
|
39 |
- (void)returnToRefererController:(FBSDKAppLinkReturnToRefererController *)controller |
e81c27
|
40 |
willNavigateToAppLink:(FBSDKAppLink *)appLink |
H |
41 |
NS_SWIFT_NAME(return(to:willNavigateTo:)); |
13e53a
|
42 |
|
H |
43 |
/*! Called after the navigation has been attempted, with an indication of whether the referer |
|
44 |
app link was successfully opened. */ |
|
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 |
|
|
52 |
/*! |
|
53 |
A controller class that implements default behavior for a FBSDKAppLinkReturnToRefererView, including |
|
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 |
|
|
60 |
/*! |
|
61 |
The delegate that will be notified when the user navigates back to the referer. |
|
62 |
*/ |
|
63 |
@property (nonatomic, weak, nullable) id<FBSDKAppLinkReturnToRefererControllerDelegate> delegate; |
|
64 |
|
|
65 |
/*! |
|
66 |
The FBSDKAppLinkReturnToRefererView this controller is controlling. |
|
67 |
*/ |
|
68 |
@property (nonatomic, strong) FBSDKAppLinkReturnToRefererView *view; |
|
69 |
|
|
70 |
/*! |
|
71 |
Initializes a controller suitable for controlling a FBSDKAppLinkReturnToRefererView that is to be displayed |
|
72 |
contained within another UIView (i.e., not displayed above the navigation bar). |
|
73 |
*/ |
|
74 |
- (instancetype)init NS_DESIGNATED_INITIALIZER; |
|
75 |
|
|
76 |
/*! |
|
77 |
Initializes a controller suitable for controlling a FBSDKAppLinkReturnToRefererView that is to be displayed |
|
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 |
|
H |
85 |
/*! |
|
86 |
Removes the view entirely from the navigation controller it is currently displayed in. |
|
87 |
*/ |
|
88 |
- (void)removeFromNavController; |
|
89 |
|
|
90 |
/*! |
|
91 |
Shows the FBSDKAppLinkReturnToRefererView with the specified referer information. If nil or missing data, |
|
92 |
the view will not be displayed. */ |
e81c27
|
93 |
- (void)showViewForRefererAppLink:(FBSDKAppLink *)refererAppLink |
H |
94 |
NS_SWIFT_NAME(showView(forReferer:)); |
13e53a
|
95 |
|
H |
96 |
/*! |
|
97 |
Shows the FBSDKAppLinkReturnToRefererView with referer information extracted from the specified URL. |
|
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 |
|
H |
102 |
/*! |
|
103 |
Closes the view, possibly animating it. |
|
104 |
*/ |
|
105 |
- (void)closeViewAnimated:(BOOL)animated; |
|
106 |
|
|
107 |
@end |
|
108 |
|
|
109 |
NS_ASSUME_NONNULL_END |