commit | author | age
|
e0ec42
|
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 |
@protocol FBSDKInfoDictionaryProviding; |
|
14 |
@protocol FBSDKUserIDProviding; |
|
15 |
|
|
16 |
NS_ASSUME_NONNULL_BEGIN |
|
17 |
|
|
18 |
/** |
|
19 |
Describes the callback for fetchDeferredAppLink. |
|
20 |
@param url the url representing the deferred App Link |
|
21 |
@param error the error during the request, if any |
|
22 |
|
|
23 |
The url may also have a fb_click_time_utc query parameter that |
|
24 |
represents when the click occurred that caused the deferred App Link to be created. |
|
25 |
*/ |
|
26 |
typedef void (^ FBSDKURLBlock)(NSURL *_Nullable url, NSError *_Nullable error) |
|
27 |
NS_SWIFT_NAME(URLBlock); |
|
28 |
|
|
29 |
/// Class containing App Links related utility methods. |
|
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 |
The handler may contain an NSError instance to capture any errors. In the |
|
46 |
common case where there simply was no app link data, the NSError instance will be nil. |
|
47 |
|
|
48 |
This method should only be called from a location that occurs after any launching URL has |
|
49 |
been processed (e.g., you should call this method from your application delegate's |
|
50 |
applicationDidBecomeActive:). |
|
51 |
*/ |
|
52 |
+ (void)fetchDeferredAppLink:(nullable FBSDKURLBlock)handler; |
|
53 |
|
|
54 |
/** |
|
55 |
Call this method to fetch promotion code from the url, if it's present. |
|
56 |
|
|
57 |
@param url App Link url that was passed to the app. |
|
58 |
|
|
59 |
@return Promotion code string. |
|
60 |
|
|
61 |
Call this method to fetch App Invite Promotion Code from applink if present. |
|
62 |
This can be used to fetch the promotion code that was associated with the invite when it |
|
63 |
was created. This method should be called with the url from the openURL method. |
|
64 |
*/ |
|
65 |
+ (nullable NSString *)appInvitePromotionCodeFromURL:(NSURL *)url; |
|
66 |
|
|
67 |
/** |
|
68 |
Check whether the scheme is defined in the app's URL schemes. |
|
69 |
@param scheme the scheme of App Link URL |
|
70 |
@return YES if the scheme is defined, otherwise NO. |
|
71 |
*/ |
|
72 |
+ (BOOL)isMatchURLScheme:(NSString *)scheme; |
|
73 |
|
|
74 |
/** |
|
75 |
Internal method exposed to facilitate transition to Swift. |
|
76 |
API Subject to change or removal without warning. Do not use. |
|
77 |
|
|
78 |
@warning INTERNAL - DO NOT USE |
|
79 |
*/ |
|
80 |
// UNCRUSTIFY_FORMAT_OFF |
|
81 |
+ (void)configureWithGraphRequestFactory:(id<FBSDKGraphRequestFactory>)graphRequestFactory |
|
82 |
infoDictionaryProvider:(id<FBSDKInfoDictionaryProviding>)infoDictionaryProvider |
|
83 |
settings:(id<FBSDKSettings>)settings |
|
84 |
appEventsConfigurationProvider:(id<FBSDKAppEventsConfigurationProviding>)appEventsConfigurationProvider |
|
85 |
advertiserIDProvider:(id<FBSDKAdvertiserIDProviding>)advertiserIDProvider |
|
86 |
appEventsDropDeterminer:(id<FBSDKAppEventDropDetermining>)appEventsDropDeterminer |
|
87 |
appEventParametersExtractor:(id<FBSDKAppEventParametersExtracting>)appEventParametersExtractor |
|
88 |
appLinkURLFactory:(id<FBSDKAppLinkURLCreating>)appLinkURLFactory |
|
89 |
userIDProvider:(id<FBSDKUserIDProviding>)userIDProvider |
|
90 |
userDataStore:(id<FBSDKUserDataPersisting>)userDataStore |
|
91 |
NS_SWIFT_NAME(configure(graphRequestFactory:infoDictionaryProvider:settings:appEventsConfigurationProvider:advertiserIDProvider:appEventsDropDeterminer:appEventParametersExtractor:appLinkURLFactory:userIDProvider:userDataStore:)); |
|
92 |
// UNCRUSTIFY_FORMAT_ON |
|
93 |
|
|
94 |
@end |
|
95 |
|
|
96 |
NS_ASSUME_NONNULL_END |
|
97 |
|
|
98 |
#endif |