为了在带有地图的 fb 自定义故事中绘制路径,我应该如何编写 GeoPoints 数组?不幸的是,fb 文档似乎对这个主题不是很详细。
让我们有一个带有“test”命名空间的自定义故事,其中包含一个从 Place 继承的“对象”。'object' 有一个 'route' 属性,它是一个 GeoPoints 数组。
NSDictionary *properties =
@{@"og:type":@"test:object",
@"og:title":@"Title",
@"object:route":
@[@{@"latitude":@37.782600, @"longitude":@-122.443265},
@{@"latitude":@37.785992, @"longitude":@-122.404813}]};
FBSDKShareOpenGraphObject *obj = [FBSDKShareOpenGraphObject objectWithProperties:properties];
FBSDKShareOpenGraphAction *action = [FBSDKShareOpenGraphAction actionWithType:@"test:action" object:obj key:@"object"];
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"object";
[FBSDKShareDialog showFromViewController:self withContent:content delegate:self];
使用此代码,我得到一个异常,因为 SDK 期望纬度和经度具有命名空间。我已经尝试过“og:纬度”和“测试:经度”,但我总是得到一张没有路径的空白地图。