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 |
|
49b883
|
19 |
#import "TargetConditionals.h" |
L |
20 |
|
|
21 |
#if !TARGET_OS_TV |
|
22 |
|
bad748
|
23 |
#import <Foundation/Foundation.h> |
W |
24 |
|
e81c27
|
25 |
NS_ASSUME_NONNULL_BEGIN |
H |
26 |
|
9febd9
|
27 |
/** |
W |
28 |
Describes the callback for fetchDeferredAppLink. |
13e53a
|
29 |
@param url the url representing the deferred App Link |
H |
30 |
@param error the error during the request, if any |
bad748
|
31 |
|
9febd9
|
32 |
|
W |
33 |
The url may also have a fb_click_time_utc query parameter that |
bad748
|
34 |
represents when the click occurred that caused the deferred App Link to be created. |
W |
35 |
*/ |
e81c27
|
36 |
typedef void (^FBSDKURLBlock)(NSURL *_Nullable url, NSError *_Nullable error) |
H |
37 |
NS_SWIFT_NAME(URLBlock); |
bad748
|
38 |
|
W |
39 |
|
9febd9
|
40 |
/** |
W |
41 |
Class containing App Links related utility methods. |
bad748
|
42 |
*/ |
e81c27
|
43 |
NS_SWIFT_NAME(AppLinkUtility) |
bad748
|
44 |
@interface FBSDKAppLinkUtility : NSObject |
e81c27
|
45 |
|
H |
46 |
- (instancetype)init NS_UNAVAILABLE; |
|
47 |
+ (instancetype)new NS_UNAVAILABLE; |
bad748
|
48 |
|
9febd9
|
49 |
/** |
W |
50 |
Call this method from the main thread to fetch deferred applink data if you use Mobile App |
bad748
|
51 |
Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). |
W |
52 |
This may require a network round trip. If successful, the handler is invoked with the link |
|
53 |
data (this will only return a valid URL once, and future calls will result in a nil URL |
|
54 |
value in the callback). |
|
55 |
|
13e53a
|
56 |
@param handler the handler to be invoked if there is deferred App Link data |
bad748
|
57 |
|
9febd9
|
58 |
|
W |
59 |
The handler may contain an NSError instance to capture any errors. In the |
bad748
|
60 |
common case where there simply was no app link data, the NSError instance will be nil. |
W |
61 |
|
|
62 |
This method should only be called from a location that occurs after any launching URL has |
|
63 |
been processed (e.g., you should call this method from your application delegate's |
|
64 |
applicationDidBecomeActive:). |
|
65 |
*/ |
e81c27
|
66 |
+ (void)fetchDeferredAppLink:(nullable FBSDKURLBlock)handler; |
bad748
|
67 |
|
W |
68 |
/* |
e81c27
|
69 |
Call this method to fetch promotion code from the url, if it's present. |
bad748
|
70 |
|
13e53a
|
71 |
@param url App Link url that was passed to the app. |
bad748
|
72 |
|
13e53a
|
73 |
@return Promotion code string. |
bad748
|
74 |
|
9febd9
|
75 |
|
W |
76 |
Call this method to fetch App Invite Promotion Code from applink if present. |
bad748
|
77 |
This can be used to fetch the promotion code that was associated with the invite when it |
W |
78 |
was created. This method should be called with the url from the openURL method. |
|
79 |
*/ |
e81c27
|
80 |
+ (nullable NSString *)appInvitePromotionCodeFromURL:(NSURL *)url; |
bad748
|
81 |
|
49b883
|
82 |
/** |
L |
83 |
Check whether the scheme is defined in the app's URL schemes. |
|
84 |
@param scheme the scheme of App Link URL |
|
85 |
@return YES if the scheme is defined, otherwise NO. |
|
86 |
*/ |
|
87 |
+ (BOOL)isMatchURLScheme:(NSString *)scheme; |
|
88 |
|
bad748
|
89 |
@end |
e81c27
|
90 |
|
H |
91 |
NS_ASSUME_NONNULL_END |
49b883
|
92 |
|
L |
93 |
#endif |