简体   繁体   English

如何知道FB Graph的响应响应于哪个请求?

[英]How to know which request a FB Graph's response respond to?

I make a call to FB graph api using FB IOS and handle the response in a delegate object which conforms to FBRequestDelegate. 我使用FB IOS调用FB graph api,并在符合FBRequestDelegate的委托对象中处理响应。 The handle functions is 句柄功能是

- (void)request:(FBRequest *)request didLoad:(id)result;

My question is that how do I know which request this response respond to if two requests with same graph path are made? 我的问题是,如果发出两个具有相同图形路径的请求,我如何知道该响应响应哪个请求?

Look into FBRequest 调查FBRequest

@interface FBRequest : NSObject {
    id<FBRequestDelegate> _delegate;
    NSString*             _url;
    NSString*             _httpMethod;
    NSMutableDictionary*  _params;
    NSURLConnection*      _connection;
    NSMutableData*        _responseText;
    FBRequestState        _state;
    NSError*              _error;
    BOOL                  _sessionDidExpire;
}

is there any of these instance variable can be used to distinguish between requests with same graph path? 这些实例变量中是否有一个可用于区分具有相同图形路径的请求?

Thanks 谢谢

you can check the request url .. im currently dealing with it like this .. for example 您可以检查请求网址..即时通讯当前正在处理像这样..例如

 if([request.url rangeOfString:@"me/feed"].location !=NSNotFound)
{
   //Do something
}
else if([request.url rangeOfString:@"fql.query"].location !=NSNotFound)
{
   //Do something
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在FB请求响应字典中获取空值 - Getting null values in FB request response dictionary 如何知道给定的日期是哪个月的哪个星期? - How to know the given date is which month's which week? 如何知道从WKWebView截获的请求来自哪个WKWebView实例? - How to know the request intercepted from WKWebView is from which WKWebView instance? 你怎么知道哪个FBRequest发起了请求didLoad:方法? - How do you know which FBRequest initiated the request didLoad: method? 我们如何从 SDK 中知道我们使用的是哪个图形 API 版本 - How do we know which graph api version we are using from the SDK 我在自定义表格视图中有FB好友图片和名称。 如何获取FB ID中的选定行并向多个朋友发送请求? - I have FB friends images and names in custom table view. How to get selected row in FB ID's and send request to multiple friends? 向Facebook Graph API发送GET请求,其中包含用户对iOS的经度和经度 - Sending a GET request to the Facebook Graph API which contains the user’s latitude and longitude for iOS 如何使用Python响应HTTP请求 - How to respond to an HTTP request using Python 在Swift 4中阅读来自Facebook Graph Request的回复 - Read response from Facebook Graph Request in Swift 4 FB Graph订阅iOS - FB Graph subscription iOS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM