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