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 |
|
|
21 |
/*! |
|
22 |
@abstract Describes the callback for fetchDeferredAppLink. |
|
23 |
@param url the url representing the deferred App Link |
|
24 |
@param error the error during the request, if any |
|
25 |
|
|
26 |
@discussion The url may also have a fb_click_time_utc query parameter that |
|
27 |
represents when the click occurred that caused the deferred App Link to be created. |
|
28 |
*/ |
|
29 |
typedef void (^FBSDKDeferredAppLinkHandler)(NSURL *url, NSError *error); |
|
30 |
|
|
31 |
|
|
32 |
/*! |
|
33 |
@abstract Describes the callback for fetchOrganicDeferredAppLink. |
|
34 |
@param url the url representing the deferred App Link |
|
35 |
*/ |
|
36 |
typedef void (^FBSDKDeferredAppInviteHandler)(NSURL *url); |
|
37 |
|
|
38 |
|
|
39 |
/*! |
|
40 |
@abstract Class containing App Links related utility methods. |
|
41 |
*/ |
|
42 |
@interface FBSDKAppLinkUtility : NSObject |
|
43 |
|
|
44 |
/*! |
|
45 |
@abstract |
|
46 |
Call this method from the main thread to fetch deferred applink data if you use Mobile App |
|
47 |
Engagement Ads (https://developers.facebook.com/docs/ads-for-apps/mobile-app-ads-engagement). |
|
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 |
|
|
52 |
@param handler the handler to be invoked if there is deferred App Link data |
|
53 |
|
|
54 |
@discussion The handler may contain an NSError instance to capture any errors. In the |
|
55 |
common case where there simply was no app link data, the NSError instance will be nil. |
|
56 |
|
|
57 |
This method should only be called from a location that occurs after any launching URL has |
|
58 |
been processed (e.g., you should call this method from your application delegate's |
|
59 |
applicationDidBecomeActive:). |
|
60 |
*/ |
|
61 |
+ (void)fetchDeferredAppLink:(FBSDKDeferredAppLinkHandler)handler; |
|
62 |
|
|
63 |
/*! |
|
64 |
@abstract Call this method from the main thread to fetch deferred deeplink for App Invites |
|
65 |
Handler is called with deeplink url, if found, nil otherwise. |
|
66 |
|
|
67 |
@param handler Handler to be called when we fetch deeplink url. |
|
68 |
|
|
69 |
@return YES if async fetch process was started, NO if it failed to start. Note it returns NO |
|
70 |
for versions < iOS 9. |
|
71 |
|
|
72 |
@discussion Call this method from the main thread to fetch deferred deeplink if you use App Invites. |
|
73 |
This may require a network round trip. If successful, this will call the handler provided, with |
|
74 |
deferred deeplink that was clicked by the user. If there is a error/timeout, handler will be called |
|
75 |
with nil. |
|
76 |
This method only works on iOS 9+ and returns NO otherwise. |
|
77 |
This method should only be called from a location that occurs after any launching URL has |
|
78 |
been processed (e.g., you should call this method from your application delegate's |
|
79 |
didFinishLaunchingWithOptions:). |
|
80 |
*/ |
|
81 |
+ (BOOL)fetchDeferredAppInvite:(FBSDKDeferredAppInviteHandler)handler; |
|
82 |
|
|
83 |
/* |
|
84 |
@abstract Call this method to fetch promotion code from the url, if it's present. This function |
|
85 |
requires Bolts framework. |
|
86 |
|
|
87 |
Note: This throws an exception if Bolts.framework is not linked. Add '[BFURL class]' in intialize method |
|
88 |
of your AppDelegate. |
|
89 |
|
|
90 |
@param url App Link url that was passed to the app. |
|
91 |
|
|
92 |
@return Promotion code string. |
|
93 |
|
|
94 |
@discussion Call this method to fetch App Invite Promotion Code from applink if present. |
|
95 |
This can be used to fetch the promotion code that was associated with the invite when it |
|
96 |
was created. This method should be called with the url from the openURL method. |
|
97 |
*/ |
|
98 |
+ (NSString*)appInvitePromotionCodeFromURL:(NSURL*)url; |
|
99 |
|
|
100 |
@end |