FBSDKGraphRequest

Represents a request to the Facebook Graph API.

Discussion:

FBSDKGraphRequest encapsulates the components of a request (the Graph API path, the parameters, error recovery behavior) and should be used in conjunction with FBSDKGraphRequestConnection to issue the request. Nearly all Graph APIs require an access token. Unless specified, the [FBSDKAccessToken currentAccessToken] is used. Therefore, most requests will require login first (see FBSDKLoginManager in FBSDKLoginKit.framework). A - start method is provided for convenience for single requests. By default, FBSDKGraphRequest will attempt to recover any errors returned from Facebook. You can disable this via disableErrorRecovery:.

Superclass:NSObject
Declared in:FBSDKGraphRequest.h
ทรัพย์สิน
graphPath

The Graph API endpoint to use for the request, for example "me".

@property (nonatomic, copy, readonly) NSString *graphPath;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
HTTPMethod

The HTTPMethod to use for the request, for example "GET" or "POST".

@property (nonatomic, copy, readonly) NSString *HTTPMethod;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
parameters

The request parameters.

@property (nonatomic, strong, readonly) NSMutableDictionary *parameters;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
tokenString

The access token string used by the request.

@property (nonatomic, copy, readonly) NSString *tokenString;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
version

The Graph API version to use (e.g., "v2.0")

@property (nonatomic, copy, readonly) NSString *version;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
วิธีการทันใจ
initWithGraphPath:parameters:

Initializes a new instance that use use [FBSDKAccessToken currentAccessToken].

พารามิเตอร์คำอธิบาย
graphPath

The graph path (e.g., @"me").

parameters

The optional parameters dictionary.

- (instancetype)
initWithGraphPath: (NSString *)graphPath
parameters: (NSDictionary *)parameters;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
initWithGraphPath:parameters:HTTPMethod:

Initializes a new instance that use use [FBSDKAccessToken currentAccessToken].

พารามิเตอร์คำอธิบาย
graphPath

The graph path (e.g., @"me").

parameters

The optional parameters dictionary.

HTTPMethod

The optional HTTP method. nil defaults to @"GET".

- (instancetype)
initWithGraphPath: (NSString *)graphPath
parameters: (NSDictionary *)parameters
HTTPMethod: (NSString *)HTTPMethod;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
initWithGraphPath:parameters:tokenString:version:HTTPMethod:

Initializes a new instance.

พารามิเตอร์คำอธิบาย
graphPath

The graph path (e.g., @"me").

parameters

The optional parameters dictionary.

tokenString

The token string to use. Specifying nil will cause no token to be used.

version

The optional Graph API version (e.g., @"v2.0"). nil defaults to [FBSDKSettings graphAPIVersion].

HTTPMethod

The optional HTTP method (e.g., @"POST"). nil defaults to @"GET".

- (instancetype)
initWithGraphPath: (NSString *)graphPath
parameters: (NSDictionary *)parameters
tokenString: (NSString *)tokenString
version: (NSString *)version
HTTPMethod: (NSString *)HTTPMethod
NS_DESIGNATED_INITIALIZER;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
setGraphErrorRecoveryDisabled:

If set, disables the automatic error recovery mechanism.

พารามิเตอร์คำอธิบาย
disable

Whether to disable the automatic error recovery mechanism

- (void) setGraphErrorRecoveryDisabled:(BOOL)disable;
Discussion:

By default, non-batched FBSDKGraphRequest instances will automatically try to recover from errors by constructing a FBSDKGraphErrorRecoveryProcessor instance that re-issues the request on successful recoveries. The re-issued request will call the same handler as the receiver but may occur with a different FBSDKGraphRequestConnection instance. This will override [FBSDKSettings setGraphErrorRecoveryDisabled:].

ให้คำรับรองไว้ใน: FBSDKGraphRequest.h
startWithCompletionHandler:

Starts a connection to the Graph API.

พารามิเตอร์คำอธิบาย
handler

The handler block to call when the request completes.

- (FBSDKGraphRequestConnection *) startWithCompletionHandler:(FBSDKGraphRequestHandler)handler;
ให้คำรับรองไว้ใน: FBSDKGraphRequest.h