Facebook iOS SDK: presentFeedDialogModallyWithSession crashes

佐手、 提交于 2019-12-24 02:14:30

问题


Using Facebook iOS SDK 3.7, Xcode 4.6, iOS simulator 6.0.

Here is my code:

NSLog (@"opening session");
[FBSession openActiveSessionWithPublishPermissions: @[@"publish_actions"]
                                   defaultAudience: FBSessionDefaultAudienceFriends
                                      allowLoginUI: YES
                                 completionHandler: nil];
NSLog (@"open active session completed");
if ([FBSession activeSession].isOpen)
{
    NSLog (@"initiating feed dialog");
    [FBWebDialogs presentFeedDialogModallyWithSession: nil
                                           parameters: nil
                                              handler: nil];
}

When executed, it crashes with the following output to the debug console:

opening session
open active session completed
initiating feed dialog
-[FBDialog initWithURL:params:isViewInvisible:frictionlessSettings:delegate:]: unrecognized selector sent to instance 0xb93c7e0

I tried several variations, they all crash; the variation above is the simplest.

Thanks very much for any help.


回答1:


The problem was that legacy code elsewhere in the system (an old version of the ShareKit library) was colliding with the Facebook SDK. When I removed the legacy code, then the code in the question above worked properly.



来源:https://stackoverflow.com/questions/18345283/facebook-ios-sdk-presentfeeddialogmodallywithsession-crashes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!