commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
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 |
|
13e53a
|
21 |
#import "FBSDKAppLinkResolving.h" |
H |
22 |
|
bad748
|
23 |
@class BFTask; |
13e53a
|
24 |
|
bad748
|
25 |
|
W |
26 |
// Check if Bolts.framework is available for import |
|
27 |
#if __has_include(<Bolts/BFAppLinkResolving.h>) |
|
28 |
// Import it if it's available |
13e53a
|
29 |
#import <Bolts/BFAppLinkResolving.h> |
bad748
|
30 |
#else |
W |
31 |
// Otherwise - redeclare BFAppLinkResolving protocol to resolve the problem of missing symbols |
|
32 |
// Please note: Bolts.framework is still required for AppLink resolving to work, |
|
33 |
// but this allows FBSDKCoreKit to weakly link Bolts.framework as well as this enables clang modulemaps to work. |
|
34 |
|
9febd9
|
35 |
/** |
bad748
|
36 |
Implement this protocol to provide an alternate strategy for resolving |
W |
37 |
App Links that may include pre-fetching, caching, or querying for App Link |
|
38 |
data from an index provided by a service provider. |
|
39 |
*/ |
13e53a
|
40 |
DEPRECATED_MSG_ATTRIBUTE("Use `FBSDKAppLinkResolving`") |
bad748
|
41 |
@protocol BFAppLinkResolving <NSObject> |
W |
42 |
|
9febd9
|
43 |
/** |
bad748
|
44 |
Asynchronously resolves App Link data for a given URL. |
W |
45 |
|
13e53a
|
46 |
@param url The URL to resolve into an App Link. |
H |
47 |
@return A BFTask that will return a BFAppLink for the given URL. |
bad748
|
48 |
*/ |
13e53a
|
49 |
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url |
H |
50 |
DEPRECATED_MSG_ATTRIBUTE("Use `appLinkFromURL:handler:`"); |
bad748
|
51 |
|
W |
52 |
@end |
|
53 |
|
|
54 |
#endif |
|
55 |
|
9febd9
|
56 |
/** |
bad748
|
57 |
|
9febd9
|
58 |
Provides an implementation of the BFAppLinkResolving protocol that uses the Facebook App Link |
bad748
|
59 |
Index API to resolve App Links given a URL. It also provides an additional helper method that can resolve |
W |
60 |
multiple App Links in a single call. |
|
61 |
|
9febd9
|
62 |
|
W |
63 |
|
bad748
|
64 |
Usage of this type requires a client token. See `[FBSDKSettings setClientToken:]` and linking |
W |
65 |
Bolts.framework |
|
66 |
*/ |
13e53a
|
67 |
#pragma clang diagnostic push |
H |
68 |
#pragma clang diagnostic ignored "-Wdeprecated-declarations" |
|
69 |
@interface FBSDKAppLinkResolver : NSObject<FBSDKAppLinkResolving, BFAppLinkResolving> |
|
70 |
#pragma clang diagnostic pop |
bad748
|
71 |
|
9febd9
|
72 |
/** |
W |
73 |
Asynchronously resolves App Link data for multiple URLs. |
bad748
|
74 |
|
13e53a
|
75 |
@param urls An array of NSURLs to resolve into App Links. |
H |
76 |
@return A BFTask that will return dictionary mapping input NSURLs to their |
bad748
|
77 |
corresponding BFAppLink. |
9febd9
|
78 |
|
bad748
|
79 |
You should set the client token before making this call. See `[FBSDKSettings setClientToken:]` |
W |
80 |
*/ |
13e53a
|
81 |
- (BFTask *)appLinksFromURLsInBackground:(NSArray<NSURL *> *)urls |
H |
82 |
DEPRECATED_MSG_ATTRIBUTE("Use `appLinkFromURLs:handler:`"); |
|
83 |
|
|
84 |
/** |
|
85 |
Asynchronously resolves App Link data for a given URL. |
|
86 |
|
|
87 |
@param url The URL to resolve into an App Link. |
|
88 |
@return A BFTask that will return a BFAppLink for the given URL. |
|
89 |
*/ |
|
90 |
- (BFTask *)appLinkFromURLInBackground:(NSURL *)url |
|
91 |
DEPRECATED_MSG_ATTRIBUTE("Use `appLinkFromURL:handler:`"); |
|
92 |
|
|
93 |
/** |
|
94 |
Asynchronously resolves App Link data for a given array of URLs. |
|
95 |
|
|
96 |
@param urls The URLs to resolve into an App Link. |
|
97 |
@param handler The completion block that will return an App Link for the given URL. |
|
98 |
*/ |
|
99 |
- (void)appLinksFromURLs:(NSArray<NSURL *> *)urls handler:(FBSDKAppLinksFromURLArrayHandler)handler |
|
100 |
NS_EXTENSION_UNAVAILABLE_IOS("Not available in app extension"); |
bad748
|
101 |
|
9febd9
|
102 |
/** |
W |
103 |
Allocates and initializes a new instance of FBSDKAppLinkResolver. |
bad748
|
104 |
*/ |
W |
105 |
+ (instancetype)resolver; |
|
106 |
|
|
107 |
@end |