commit | author | age
|
bad748
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
W |
2 |
// |
|
3 |
// You are hereby granted a non-exclusive, worldwide, royalty-free license to use, |
|
4 |
// copy, modify, and distribute this software in source code or binary form for use |
|
5 |
// in connection with the web services and APIs provided by Facebook. |
|
6 |
// |
|
7 |
// As with any software that integrates with the Facebook platform, your use of |
|
8 |
// this software is subject to the Facebook Developer Principles and Policies |
|
9 |
// [http://developers.facebook.com/policy/]. This copyright notice shall be |
|
10 |
// included in all copies or substantial portions of the software. |
|
11 |
// |
|
12 |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|
13 |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
|
14 |
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
15 |
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
|
16 |
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
|
17 |
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
18 |
|
|
19 |
#import <Foundation/Foundation.h> |
|
20 |
|
9febd9
|
21 |
/** |
W |
22 |
Describes the callback for fetchDeferredAppLink. |
|
23 |
- Parameter url: the url representing the deferred App Link |
|
24 |
- Parameter error: the error during the request, if any |
bad748
|
25 |
|
9febd9
|
26 |
|
W |
27 |
The url may also have a fb_click_time_utc query parameter that |
bad748
|
28 |
represents when the click occurred that caused the deferred App Link to be created. |
W |
29 |
*/ |
|
30 |
typedef void (^FBSDKDeferredAppLinkHandler)(NSURL *url, NSError *error); |
|
31 |
|
|
32 |
|
9febd9
|
33 |
/** |
W |
34 |
Describes the callback for fetchOrganicDeferredAppLink. |
|
35 |
- Parameter url: the url representing the deferred App Link |
bad748
|
36 |
*/ |
W |
37 |
typedef void (^FBSDKDeferredAppInviteHandler)(NSURL *url); |
|
38 |
|
|
39 |
|
9febd9
|
40 |
/** |
W |
41 |
Class containing App Links related utility methods. |
bad748
|
42 |
*/ |
W |
43 |
@interface FBSDKAppLinkUtility : NSObject |
|
44 |
|
9febd9
|
45 |
/** |
W |
46 |
Call this method from the main thread to fetch deferred applink data if you use Mobile App |
bad748
|
47 |
Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). |
W |
48 |
This may require a network round trip. If successful, the handler is invoked with the link |
|
49 |
data (this will only return a valid URL once, and future calls will result in a nil URL |
|
50 |
value in the callback). |
|
51 |
|
9febd9
|
52 |
- Parameter handler: the handler to be invoked if there is deferred App Link data |
bad748
|
53 |
|
9febd9
|
54 |
|
W |
55 |
The handler may contain an NSError instance to capture any errors. In the |
bad748
|
56 |
common case where there simply was no app link data, the NSError instance will be nil. |
W |
57 |
|
|
58 |
This method should only be called from a location that occurs after any launching URL has |
|
59 |
been processed (e.g., you should call this method from your application delegate's |
|
60 |
applicationDidBecomeActive:). |
|
61 |
*/ |
|
62 |
+ (void)fetchDeferredAppLink:(FBSDKDeferredAppLinkHandler)handler; |
|
63 |
|
9febd9
|
64 |
/** |
bad748
|
65 |
|
9febd9
|
66 |
- Warning:This method is no longer available and will always return NO. |
bad748
|
67 |
*/ |
9febd9
|
68 |
+ (BOOL)fetchDeferredAppInvite:(FBSDKDeferredAppInviteHandler)handler |
W |
69 |
__attribute__((deprecated("This method is no longer available.")));; |
bad748
|
70 |
|
W |
71 |
/* |
9febd9
|
72 |
Call this method to fetch promotion code from the url, if it's present. This function |
bad748
|
73 |
requires Bolts framework. |
W |
74 |
|
|
75 |
Note: This throws an exception if Bolts.framework is not linked. Add '[BFURL class]' in intialize method |
|
76 |
of your AppDelegate. |
|
77 |
|
9febd9
|
78 |
- Parameter url: App Link url that was passed to the app. |
bad748
|
79 |
|
9febd9
|
80 |
- Returns: Promotion code string. |
bad748
|
81 |
|
9febd9
|
82 |
|
W |
83 |
Call this method to fetch App Invite Promotion Code from applink if present. |
bad748
|
84 |
This can be used to fetch the promotion code that was associated with the invite when it |
W |
85 |
was created. This method should be called with the url from the openURL method. |
|
86 |
*/ |
|
87 |
+ (NSString*)appInvitePromotionCodeFromURL:(NSURL*)url; |
|
88 |
|
|
89 |
@end |