我一直在運行this tutorial並且一切都很順利,直到我嘗試發佈到用戶牆。我可以得到用戶的信息,名字,姓氏,教育等等。但是,當我做到以下幾點:面向iOS的Facebook圖形API給出錯誤驗證應用程序
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/me/feed"]];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:@"Posted from Swangle for iPhone" forKey:@"message"];
[request setPostValue:@"Swangle for Iphone" forKey:@"name"];
[request setPostValue:@"Coming Soon..." forKey:@"caption"];
[request setPostValue:@"Description" forKey:@"description"];
[request setPostValue:_accessToken forKey:@"access_token"];
[request setDidFinishSelector:@selector(postToWallFinished:)];
[request setDelegate:self];
[request startAsynchronous];
- (void)postToWallFinished:(ASIHTTPRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
NSLog(@"Response String : %@ and request : %@", responseString, request);
NSMutableDictionary *responseJSON = [responseString JSONValue];
NSString *postId = [responseJSON objectForKey:@"id"];
NSLog(@"Post id is: %@", postId);
UIAlertView *av = [[[UIAlertView alloc] initWithTitle:@"Sucessfully posted to photos & wall!"
message:@"Check out your Facebook to see!"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil] autorelease];
[av show];
}
我回到
Post id is : {"error":{"message":"Error validating application.","type":"OAuthException"}}
我知道,因爲我允許用它登錄的是的access_token正確。
此外,我在developers.facebook上創建了一個應用程序,並使用正確的密鑰訪問其數據庫。
有人可以請教我,或指出我在正確的方向弄清楚這一點嗎?
謝謝!
雅時我第一次登錄時,我被要求授權,我說是的。 –