commit | author | age
|
bad748
|
1 |
/* |
W |
2 |
* Copyright (c) 2014, Facebook, Inc. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the BSD-style license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. An additional grant |
|
7 |
* of patent rights can be found in the PATENTS file in the same directory. |
|
8 |
* |
|
9 |
*/ |
|
10 |
|
|
11 |
#import <Foundation/Foundation.h> |
|
12 |
|
|
13 |
@class BFAppLink; |
|
14 |
|
|
15 |
/*! |
|
16 |
Provides a set of utilities for working with NSURLs, such as parsing of query parameters |
|
17 |
and handling for App Link requests. |
|
18 |
*/ |
|
19 |
@interface BFURL : NSObject |
|
20 |
|
|
21 |
/*! |
|
22 |
Creates a link target from a raw URL. |
|
23 |
On success, this posts the BFAppLinkParseEventName measurement event. If you are constructing the BFURL within your application delegate's |
|
24 |
application:openURL:sourceApplication:annotation:, you should instead use URLWithInboundURL:sourceApplication: |
|
25 |
to support better BFMeasurementEvent notifications |
|
26 |
@param url The instance of `NSURL` to create BFURL from. |
|
27 |
*/ |
|
28 |
+ (BFURL *)URLWithURL:(NSURL *)url; |
|
29 |
|
|
30 |
/*! |
|
31 |
Creates a link target from a raw URL received from an external application. This is typically called from the app delegate's |
|
32 |
application:openURL:sourceApplication:annotation: and will post the BFAppLinkNavigateInEventName measurement event. |
|
33 |
@param url The instance of `NSURL` to create BFURL from. |
|
34 |
@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: |
|
35 |
*/ |
|
36 |
+ (BFURL *)URLWithInboundURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication; |
|
37 |
|
|
38 |
/*! |
|
39 |
Gets the target URL. If the link is an App Link, this is the target of the App Link. |
|
40 |
Otherwise, it is the url that created the target. |
|
41 |
*/ |
|
42 |
@property (nonatomic, strong, readonly) NSURL *targetURL; |
|
43 |
|
|
44 |
/*! |
|
45 |
Gets the query parameters for the target, parsed into an NSDictionary. |
|
46 |
*/ |
|
47 |
@property (nonatomic, strong, readonly) NSDictionary *targetQueryParameters; |
|
48 |
|
|
49 |
/*! |
|
50 |
If this link target is an App Link, this is the data found in al_applink_data. |
|
51 |
Otherwise, it is nil. |
|
52 |
*/ |
|
53 |
@property (nonatomic, strong, readonly) NSDictionary *appLinkData; |
|
54 |
|
|
55 |
/*! |
|
56 |
If this link target is an App Link, this is the data found in extras. |
|
57 |
*/ |
|
58 |
@property (nonatomic, strong, readonly) NSDictionary *appLinkExtras; |
|
59 |
|
|
60 |
/*! |
|
61 |
The App Link indicating how to navigate back to the referer app, if any. |
|
62 |
*/ |
|
63 |
@property (nonatomic, strong, readonly) BFAppLink *appLinkReferer; |
|
64 |
|
|
65 |
/*! |
|
66 |
The URL that was used to create this BFURL. |
|
67 |
*/ |
|
68 |
@property (nonatomic, strong, readonly) NSURL *inputURL; |
|
69 |
|
|
70 |
/*! |
|
71 |
The query parameters of the inputURL, parsed into an NSDictionary. |
|
72 |
*/ |
|
73 |
@property (nonatomic, strong, readonly) NSDictionary *inputQueryParameters; |
|
74 |
|
|
75 |
@end |