Facebook iOS SDK 3.x Feed对话框不见了? [英] Facebook iOS SDK 3.x feed dialog is gone?

查看:148
本文介绍了Facebook iOS SDK 3.x Feed对话框不见了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天我开始使用,他在评论中提到,使用新的 SDK 3.2 不需要你再包括不推荐的类:


改进的Web对话框支持:此版本增加了对
Web对话框的集成的支持, feed dialog 请求对话框,而不调用
已弃用标题,使您更简单地将对话框添加到
您的应用程序。


示例:

  NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@,@name,
@ ,@caption,
@,@description,
@https://website.com/share,@link,
@http ://website.com/iossdk_logo.png,@picture,
nil];
[FBWebDialogs presentFeedDialogModallyWithSession:nil
参数:params
处理程序:
^(FBWebDialogResult结果,NSURL * resultURL,NSError *错误){
if(error){
//启动对话框或发布故事时出错。
NSLog(@发布故事错误);
} else {
if(result == FBWebDialogResultDialogNotCompleted){
//用户点击x图标
NSLog(@用户已取消故事发布);
} else {
//处理发布Feed回调
}
}
}];


Today I started to use Facebook SDK 3.0 for iOS and I realized that there is no FBDialog class anymore. I've searched developers.facebook.com for some tutorials how I can show feed dialog using new sdk.

We used to write:

[facebook dialog:@"feed" andParams:params andDelegate:self];

But, it seems that all tips talking about dialogs are related to old SDK in developers.facebook.com.

Did anybody implemented feed dialog with new SDK?

Or, should we build our own DialogViewController to represent all UI elements as textFields, send button in order to make FBRequest?!

解决方案

I've found the answer here:
Feed Dialog - Facebook Developers

Using the same new SDK 3.x we must add deprecated headers into Frameworks:





and change:

#import <FacebookSDK/FacebookSDK.h>

to

#import "Facebook.h"


EDIT (26.02.2013):

Thanks to Andreas, he mentioned in comment, using new SDK 3.2 doesn't required you include deprecated classes anymore:

Improved Web dialog support: This release adds support for integrating Web dialogs, feed dialog, and requests dialog, without invoking deprecated headers, making it cleaner and easier to add dialogs into your app.

Example:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     @"", @"name",
     @"", @"caption",
     @"", @"description",
     @"https://website.com/share", @"link",
     @"http://website.com/iossdk_logo.png", @"picture",
     nil];
[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
                 }
             }
        }];

这篇关于Facebook iOS SDK 3.x Feed对话框不见了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆