facebook graphapi多个图像共享和位置操作

时间:2015-11-16 12:50:08

标签: ios facebook facebook-graph-api facebook-ios-sdk

这是facebook网站上的示例代码..工作正常。

 NSDictionary *properties = @{
                                     @"og:type": @"books.book",
                                     @"og:title": @"SmartFission",
                                     @"og:description": @"This is smartfission",
                                     // @"books:isbn": @"0-553-57340-3",
                                     };

        FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

        // Create an action
        FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
        action.actionType = @"books.reads";
        [action setObject:object forKey:@"books:book"];

        // Add the photo to the action. Actions
        // can take an array of images.
        [action setArray:arrPhoto forKey:@"image"];

        // Create the content
        FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
        content.action = action;
        content.previewPropertyName = @"books:book";       
    [FBSDKShareDialog showFromViewController:self
                                         withContent:content
                                            delegate:self];

我想要的是分享我访问过的图像和当前位置。我试着跟随..

NSDictionary *properties = @{
                                     @"og:type": @"place",
                                     @"og:title": @"SmartFission",
                                     @"og:description": @"This is smartfission",
                                      @"place:location:latitude": @"37.484828",
                      @"place:location:longitude": @"-122.148283"
                                     };

        FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];

        // Create an action
        FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
        action.actionType = @"restaurant.visited";
        [action setObject:object forKey:@"place"];

        // Add the photo to the action. Actions
        // can take an array of images.
        [action setArray:arrPhoto forKey:@"image"];

        // Create the content
        FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
        content.action = action;
        content.previewPropertyName = @"place";       
    [FBSDKShareDialog showFromViewController:self
                                         withContent:content
                                            delegate:self];

我收到以下错误:

  

错误Domain = com.facebook.Facebook.platform Code = 102"(null)"   UserInfo = {error_reason =无法完成操作。   (FBAPIErrorDomain错误1611072.),error_description =发生错误   在发布期间。,app_id = 967614566643689,​​error_code = 102}

我尝试使用其他操作和对象,他们也给出错误。只有示例代码运行。任何形式的帮助都会被贬低。感谢名单

0 个答案:

没有答案