iOSアプリで次のFQLステートメントを機能させようとしています
SELECT comment_info,likes,share_count FROM stream WHERE post_id
何らかの理由で、グラフAPIからエラーが発生し続けます
解析エラー: 予期しない「?」位置 70 OAuth 例外
位置が動くのでなぜか「?」SLRequests の末尾に追加されていますか? これが私が使用しているコードのブロックです。私は多くのことを試しましたが、まだこれを取り除くことはできませんが、同じ方法を使用して /me/home を引っ張るとうまくいきます。
NSLog(@"ID: %@", graphID);
NSString* urlText = [NSString stringWithFormat: @"https://graph.facebook.com/fql?q=SELECT comment_info,likes,share_count FROM stream WHERE post_id = '%@'", graphID];
urlText = [urlText stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL URLWithString: urlText];
SLRequest * request = [SLRequest requestForServiceType:SLServiceTypeFacebook requestMethod:SLRequestMethodGET URL:url parameters: nil];
request.account = self.facebookAccount;
[request performRequestWithHandler:^(NSData *responseData, NSHTTPURLResponse *urlResponse, NSError *error) {
NSLog(@"url %@", request.URL.absoluteURL);
NSString * responseString = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSError* responseError;
NSDictionary* jsonDict = [NSJSONSerialization JSONObjectWithData:[responseString dataUsingEncoding:NSUTF8StringEncoding] options:kNilOptions error:&responseError];
NSArray * dataArray = jsonDict[@"data"];
[dataArray enumerateObjectsUsingBlock:^(NSDictionary * infoDictionary, NSUInteger idx, BOOL *stop) {
NSNumber *likesCount;
NSNumber *commentsCount;
likesCount = [NSNumber numberWithInt: [infoDictionary[@"likes"][@"count"] integerValue]];
commentsCount = [NSNumber numberWithInt: [infoDictionary[@"comment_info"][@"comment_count"] integerValue]];
NSLog(@"likes %@", likesCount);
}];
}];