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