0

我的目标是在不实现后端 Web 服务器的情况下实现类似的目标:

http://i.stack.imgur.com/QjA21.png

目前,我正在使用此代码:

id<FBOpenGraphAction> _action = (id<FBOpenGraphAction>)[FBGraphObject graphObject];

_action[@"book"] = @{
                   @"type":@"books.book",
                   @"fbsdk:create_object": @YES,
                   @"title":@"test title 1",
                   @"url":@"http://test-test.test",
                   @"image":@"http://www.m5zn.com/uploads/2010/7/15/photo/071510030742woekhs48rdt1ifcwp.jpg",

                   @"description": @"development in progress - test description",
                   @"data": @{@"isbn":@"0-316-31696-2"}
                   };


[FBSettings enableBetaFeature:FBBetaFeaturesOpenGraphShareDialog];


[FBDialogs presentShareDialogWithOpenGraphAction:_action
                                      actionType:@"books.reads"
                             previewPropertyName:@"book"
                                         handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
                                             if(error) {
                                                 NSLog(@"Error: %@", error.description);
                                             } else {
                                                 NSLog(@"Success!");
                                             }
                                         }];

运行该代码时没有记录任何内容。此外,这里是 AppDelegate 片段:

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
         annotation:(id)annotation {
    // attempt to extract a token from the url


    return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication withSession:FBSession.activeSession fallbackHandler:^(FBAppCall *call) {
        DLog(@"in fallback handler");
    }];

    // return [FBSession.activeSession handleOpenURL:url];

}

我试图遵循这个例子:https ://www.youtube.com/watch?v= mLuaUtbGvEM#at=322 在本文末尾找到:https ://developers.facebook.com/docs/opengraph/using-对象-api/

然而,共享对话没有出现,控制台中也没有记录任何内容。什么地方出了错?我缺少一些依赖项吗?我的视图控制器是否不符合某些协议?是否没有调用某些处理程序?W

要使其正常工作还需要什么?

4

0 回答 0