0
Iam使用以下代碼在我朋友的Facebook牆上發佈消息。此代碼將消息發佈到登錄用戶牆上,但不發送給朋友的牆presentFeedDialogModallywithSession不會發布消息給朋友
Iam也給予「to」值,即朋友的facebook標識(116623456)和App_id,但同樣的問題仍然存在。
請提供一個很好的方向。
- (void)facebookViewControllerDoneWasPressed:(id)sender
{
NSLog(@"DonePressed Called");
NSString* fid;
NSString* fbUserName;
NSString *message = [NSString stringWithFormat:@"You have been selected as a health coach(Multiple Users1), You will be receiving daily and weekly reports from here on!!!!"];
NSLog(@"Before For");
// NSString *SelectedFriends = nil;
for (id<FBGraphUser> user in _friendPickerController.selection)
{
fid = user.id;
fbUserName = user.name;
NSLog(@"User Name =%@, USer id =%@",fbUserName, fid);
}
NSLog(@"After For");
NSLog(@"%@",fid);
NSMutableDictionary *params =
[NSMutableDictionary dictionaryWithObjectsAndKeys:
@"4444444444444444",@"app_id",
fid,@"to",
nil];
// Invoke the dialog
[FBWebDialogs presentFeedDialogModallyWithSession:nil
parameters:params
handler:
^(FBWebDialogResult result, NSURL *resultURL, NSError *error) {
if (error) {
// Error launching the dialog or publishing a story.
NSLog(@"Error publishing story.");
} else {
if (result == FBWebDialogResultDialogNotCompleted) {
// User clicked the "x" icon
NSLog(@"User canceled story publishing.");
} else {
// Handle the publish feed callback
NSDictionary *urlParams = [self parseURLParams:[resultURL query]];
if (![urlParams valueForKey:@"post_id"]) {
// User clicked the Cancel button
NSLog(@"User canceled story publishing.");
} else {
// User clicked the Share button
// Show the result in an alert
[[[UIAlertView alloc] initWithTitle:@"Result"
message:@"Message Posted Successfully"
delegate:self
cancelButtonTitle:@"OK!"
otherButtonTitles:nil]
show];
}
}
}
}];
}
我已經使用這個代碼,但它給了我HTTP狀態碼錯誤403和一個問題...是startWithGraphPath不是從2013年3月 – user2525018
其新的Facebook SDK代碼depricated。 .. – hitesh
你可以看看這裏http://stackoverflow.com/questions/11792427/new-ios-sdk-3-0-posting-to-a-users-wall-without-deprecated-api 這個電話號碼Facebook的2013年2月突破性改變之後的更長時間的作品。 developers.facebook.com/roadmap/completed-changes發佈到朋友牆上的唯一方法是通過Feed對話框並使用Deprecated Headers。 - Scott Lieberman 4月22日21:49 – user2525018