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 |
@protocol FBSDKAppLink; |
e0ec42
|
16 |
@protocol FBSDKAppLinkCreating; |
2e29a3
|
17 |
|
L |
18 |
/** |
|
19 |
Provides a set of utilities for working with NSURLs, such as parsing of query parameters |
|
20 |
and handling for App Link requests. |
|
21 |
*/ |
|
22 |
NS_SWIFT_NAME(AppLinkURL) |
e0ec42
|
23 |
@interface FBSDKURL : NSObject <FBSDKAppLinkURL> |
2e29a3
|
24 |
|
L |
25 |
- (instancetype)init NS_UNAVAILABLE; |
|
26 |
+ (instancetype)new NS_UNAVAILABLE; |
|
27 |
|
|
28 |
/** |
|
29 |
Creates a link target from a raw URL. |
|
30 |
On success, this posts the FBSDKAppLinkParseEventName measurement event. If you are constructing the FBSDKURL within your application delegate's |
|
31 |
application:openURL:sourceApplication:annotation:, you should instead use URLWithInboundURL:sourceApplication: |
|
32 |
to support better FBSDKMeasurementEvent notifications |
|
33 |
@param url The instance of `NSURL` to create FBSDKURL from. |
|
34 |
*/ |
|
35 |
|
|
36 |
// UNCRUSTIFY_FORMAT_OFF |
|
37 |
+ (instancetype)URLWithURL:(NSURL *)url |
|
38 |
NS_SWIFT_NAME(init(url:)); |
|
39 |
// UNCRUSTIFY_FORMAT_ON |
|
40 |
|
|
41 |
/** |
|
42 |
Creates a link target from a raw URL received from an external application. This is typically called from the app delegate's |
|
43 |
application:openURL:sourceApplication:annotation: and will post the FBSDKAppLinkNavigateInEventName measurement event. |
|
44 |
@param url The instance of `NSURL` to create FBSDKURL from. |
|
45 |
@param sourceApplication the bundle ID of the app that is requesting your app to open the URL. The same sourceApplication in application:openURL:sourceApplication:annotation: |
|
46 |
*/ |
|
47 |
|
|
48 |
// UNCRUSTIFY_FORMAT_OFF |
|
49 |
+ (instancetype)URLWithInboundURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication |
|
50 |
NS_SWIFT_NAME(init(inboundURL:sourceApplication:)); |
|
51 |
// UNCRUSTIFY_FORMAT_ON |
|
52 |
|
|
53 |
/** |
|
54 |
Gets the target URL. If the link is an App Link, this is the target of the App Link. |
|
55 |
Otherwise, it is the url that created the target. |
|
56 |
*/ |
|
57 |
@property (nonatomic, readonly, strong) NSURL *targetURL; |
|
58 |
|
e0ec42
|
59 |
/// Gets the query parameters for the target, parsed into an NSDictionary. |
2e29a3
|
60 |
@property (nonatomic, readonly, strong) NSDictionary<NSString *, id> *targetQueryParameters; |
L |
61 |
|
|
62 |
/** |
|
63 |
If this link target is an App Link, this is the data found in al_applink_data. |
|
64 |
Otherwise, it is nil. |
|
65 |
*/ |
|
66 |
@property (nullable, nonatomic, readonly, strong) NSDictionary<NSString *, id> *appLinkData; |
|
67 |
|
e0ec42
|
68 |
/// If this link target is an App Link, this is the data found in extras. |
2e29a3
|
69 |
@property (nullable, nonatomic, readonly, strong) NSDictionary<NSString *, id> *appLinkExtras; |
L |
70 |
|
e0ec42
|
71 |
/// The App Link indicating how to navigate back to the referer app, if any. |
2e29a3
|
72 |
@property (nullable, nonatomic, readonly, strong) id<FBSDKAppLink> appLinkReferer; |
L |
73 |
|
e0ec42
|
74 |
/// The URL that was used to create this FBSDKURL. |
2e29a3
|
75 |
@property (nonatomic, readonly, strong) NSURL *inputURL; |
L |
76 |
|
e0ec42
|
77 |
/// The query parameters of the inputURL, parsed into an NSDictionary. |
2e29a3
|
78 |
@property (nonatomic, readonly, strong) NSDictionary<NSString *, id> *inputQueryParameters; |
L |
79 |
|
e0ec42
|
80 |
/// The flag indicating whether the URL comes from auto app link |
2e29a3
|
81 |
@property (nonatomic, readonly, getter = isAutoAppLink) BOOL isAutoAppLink; |
L |
82 |
|
e0ec42
|
83 |
/** |
L |
84 |
Internal method exposed to facilitate transition to Swift. |
|
85 |
API Subject to change or removal without warning. Do not use. |
|
86 |
|
|
87 |
@warning INTERNAL - DO NOT USE |
|
88 |
*/ |
|
89 |
// UNCRUSTIFY_FORMAT_OFF |
|
90 |
+ (void)configureWithSettings:(id<FBSDKSettings>)settings |
|
91 |
appLinkFactory:(id<FBSDKAppLinkCreating>)appLinkFactory |
|
92 |
appLinkTargetFactory:(id<FBSDKAppLinkTargetCreating>)appLinkTargetFactory |
|
93 |
appLinkEventPoster:(id<FBSDKAppLinkEventPosting>)appLinkEventPoster |
|
94 |
NS_SWIFT_NAME(configure(settings:appLinkFactory:appLinkTargetFactory:appLinkEventPoster:)); |
|
95 |
// UNCRUSTIFY_FORMAT_ON |
|
96 |
|
2e29a3
|
97 |
@end |
L |
98 |
|
|
99 |
NS_ASSUME_NONNULL_END |
|
100 |
|
|
101 |
#endif |