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 |
#import <Foundation/Foundation.h> |
|
10 |
|
|
11 |
#import <FBSDKCoreKit/FBSDKGraphRequestConnecting.h> |
|
12 |
|
|
13 |
NS_ASSUME_NONNULL_BEGIN |
|
14 |
|
|
15 |
/** |
|
16 |
@protocol |
|
17 |
|
|
18 |
The `FBSDKGraphRequestConnectionDelegate` protocol defines the methods used to receive network |
|
19 |
activity progress information from a <FBSDKGraphRequestConnection>. |
|
20 |
*/ |
|
21 |
NS_SWIFT_NAME(GraphRequestConnectionDelegate) |
|
22 |
@protocol FBSDKGraphRequestConnectionDelegate <NSObject> |
|
23 |
|
|
24 |
@optional |
|
25 |
|
|
26 |
/** |
|
27 |
@method |
|
28 |
|
|
29 |
Tells the delegate the request connection will begin loading |
|
30 |
|
|
31 |
If the <FBSDKGraphRequestConnection> is created using one of the convenience factory methods prefixed with |
|
32 |
start, the object returned from the convenience method has already begun loading and this method |
|
33 |
will not be called when the delegate is set. |
|
34 |
|
|
35 |
@param connection The request connection that is starting a network request |
|
36 |
*/ |
|
37 |
- (void)requestConnectionWillBeginLoading:(id<FBSDKGraphRequestConnecting>)connection; |
|
38 |
|
|
39 |
/** |
|
40 |
@method |
|
41 |
|
|
42 |
Tells the delegate the request connection finished loading |
|
43 |
|
|
44 |
If the request connection completes without a network error occurring then this method is called. |
|
45 |
Invocation of this method does not indicate success of every <FBSDKGraphRequest> made, only that the |
|
46 |
request connection has no further activity. Use the error argument passed to the FBSDKGraphRequestBlock |
|
47 |
block to determine success or failure of each <FBSDKGraphRequest>. |
|
48 |
|
|
49 |
This method is invoked after the completion handler for each <FBSDKGraphRequest>. |
|
50 |
|
|
51 |
@param connection The request connection that successfully completed a network request |
|
52 |
*/ |
|
53 |
- (void)requestConnectionDidFinishLoading:(id<FBSDKGraphRequestConnecting>)connection; |
|
54 |
|
|
55 |
/** |
|
56 |
@method |
|
57 |
|
|
58 |
Tells the delegate the request connection failed with an error |
|
59 |
|
|
60 |
If the request connection fails with a network error then this method is called. The `error` |
|
61 |
argument specifies why the network connection failed. The `NSError` object passed to the |
|
62 |
FBSDKGraphRequestBlock block may contain additional information. |
|
63 |
|
|
64 |
@param connection The request connection that successfully completed a network request |
|
65 |
@param error The `NSError` representing the network error that occurred, if any. May be nil |
|
66 |
in some circumstances. Consult the `NSError` for the <FBSDKGraphRequest> for reliable |
|
67 |
failure information. |
|
68 |
*/ |
|
69 |
- (void)requestConnection:(id<FBSDKGraphRequestConnecting>)connection |
|
70 |
didFailWithError:(NSError *)error; |
|
71 |
|
|
72 |
/** |
|
73 |
@method |
|
74 |
|
|
75 |
Tells the delegate how much data has been sent and is planned to send to the remote host |
|
76 |
|
|
77 |
The byte count arguments refer to the aggregated <FBSDKGraphRequest> objects, not a particular <FBSDKGraphRequest>. |
|
78 |
|
|
79 |
Like `NSURLSession`, the values may change in unexpected ways if data needs to be resent. |
|
80 |
|
|
81 |
@param connection The request connection transmitting data to a remote host |
|
82 |
@param bytesWritten The number of bytes sent in the last transmission |
|
83 |
@param totalBytesWritten The total number of bytes sent to the remote host |
|
84 |
@param totalBytesExpectedToWrite The total number of bytes expected to send to the remote host |
|
85 |
*/ |
|
86 |
- (void) requestConnection:(id<FBSDKGraphRequestConnecting>)connection |
|
87 |
didSendBodyData:(NSInteger)bytesWritten |
|
88 |
totalBytesWritten:(NSInteger)totalBytesWritten |
|
89 |
totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite; |
|
90 |
|
|
91 |
@end |
|
92 |
|
|
93 |
NS_ASSUME_NONNULL_END |