commit | author | age
|
b19a78
|
1 |
// Copyright (c) 2014-present, Facebook, Inc. All rights reserved. |
L |
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 |
#import "FBSDKGraphRequestHTTPMethod.h" |
|
22 |
|
|
23 |
NS_ASSUME_NONNULL_BEGIN |
|
24 |
|
|
25 |
@protocol FBSDKGraphRequestConnecting; |
|
26 |
|
|
27 |
@class FBSDKGraphRequestConnection; |
|
28 |
typedef void (^FBSDKGraphRequestBlock)(FBSDKGraphRequestConnection *_Nullable connection, |
|
29 |
id _Nullable result, |
|
30 |
NSError *_Nullable error); |
|
31 |
|
|
32 |
/// A protocol to describe anything that represents a graph request |
|
33 |
NS_SWIFT_NAME(GraphRequestProtocol) |
|
34 |
@protocol FBSDKGraphRequest |
|
35 |
|
|
36 |
/** |
|
37 |
The request parameters. |
|
38 |
*/ |
|
39 |
@property (nonatomic, copy) NSDictionary<NSString *, id> *parameters; |
|
40 |
|
|
41 |
/** |
|
42 |
The access token string used by the request. |
|
43 |
*/ |
|
44 |
@property (nonatomic, copy, readonly, nullable) NSString *tokenString; |
|
45 |
|
|
46 |
/** |
|
47 |
The Graph API endpoint to use for the request, for example "me". |
|
48 |
*/ |
|
49 |
@property (nonatomic, copy, readonly) NSString *graphPath; |
|
50 |
|
|
51 |
/** |
|
52 |
The HTTPMethod to use for the request, for example "GET" or "POST". |
|
53 |
*/ |
|
54 |
@property (nonatomic, copy, readonly) FBSDKHTTPMethod HTTPMethod; |
|
55 |
|
|
56 |
/** |
|
57 |
The Graph API version to use (e.g., "v2.0") |
|
58 |
*/ |
|
59 |
@property (nonatomic, copy, readonly) NSString *version; |
|
60 |
|
|
61 |
/** |
|
62 |
Starts a connection to the Graph API. |
|
63 |
@param handler The handler block to call when the request completes. |
|
64 |
*/ |
|
65 |
- (id<FBSDKGraphRequestConnecting>)startWithCompletionHandler:(nullable FBSDKGraphRequestBlock)handler; |
|
66 |
|
|
67 |
/** |
|
68 |
A formatted description of the graph request |
|
69 |
*/ |
|
70 |
- (NSString *)formattedDescription; |
|
71 |
|
|
72 |
@end |
|
73 |
|
|
74 |
NS_ASSUME_NONNULL_END |