iPhoneアプリケーションの壁にFacebookポスティングを実装することに問題があります。 SDKとリンクされたフレームワークをインストールしました ログインが正常に動作しています。コードは次のとおりです。iPhoneアプリの壁にsdkポスト
-(IBAction)loginButtonPressed:(id)sender
{
NSLog(@"loginButtonPressed: called");
AppDelegate *appdel=[[UIApplication sharedApplication] delegate];
appdel.facebookSession=[[FBSession alloc] init];
[appdel.facebookSession openWithCompletionHandler:^(FBSession *session,
FBSessionState status,
NSError *error)
{
//
}];
}
しかし、ユーザーの壁にメッセージを投稿する際に問題があります。コードは次のとおりです。
-(IBAction)likeButtonPressed:(id)sender
{
NSLog(@"likeButtonPressed: called");
// Post a status update to the user's feedm via the Graph API, and display an alert view
// with the results or an error.
NSString *message = @"test message";
NSDictionary *params = [NSDictionary dictionaryWithObject:message forKey:@"message"];
// use the "startWith" helper static on FBRequest to both create and start a request, with
// a specified completion handler.
[FBRequest startWithGraphPath:@"me/feed"
parameters:params
HTTPMethod:@"POST"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:message result:result error:error];
}];
}
お願いします。私のコードに何が問題なのですか?または、ログイン要求にいくつかの権限を追加する必要がありますか?
。 – CBroe
Facebookの投稿を開始するときにログインフォームが表示されますか? –
私はデバッグ中に「エラー:HTTPステータスコード:400」と「操作を完了できませんでした。 (com.facebook.FBIOSSDKエラー5) 'ÍIAlertView'で – user1385666