如何在IOS中将图像的位置发布到Facebook?

rah*_*hul 6 location facebook sharing ios

我正在尝试与Facebook共享位置和图像.我已成功共享图片但无法共享位置.以下是我分享图片的代码.

UIImage *facebookImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imagesURL,str]]]];
NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
[params setObject:@"New Happening created on the HappenShare mobile app." forKey:@"message"];
[params setObject:facebookImage forKey:@"picture"];
[FBRequestConnection startWithGraphPath:@"me/photos" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection,id result,NSError *error)
{
    if (error)
    {
        NSLog(@"error : %@",error);
    }
    else
    {
        NSLog(@"Result : %@",result);
    }
}];
Run Code Online (Sandbox Code Playgroud)

现在为了共享位置我应该在上面的代码中添加什么参数.我附加图像也是为了更好地理解共享位置的外观.下图显示带有文本的图像如何指示地图中的位置.请为我建议一个解决方案. 在此输入图像描述

Tob*_*obi 0

您需要place在 上的 POST 请求中设置(实际上是页面 ID)字段/me/photos

请参阅https://developers.facebook.com/docs/graph-api/reference/v2.0/user/photos/#publish

在 iOS 上,您可以使用 FB iOS SDK 的 PlacePicker UI 组件来实现此目的,如下所述:https: //developers.facebook.com/docs/ios/ui-controls#placepicker