使用地图创建开放图故事 - iOS
Posted
技术标签:
【中文标题】使用地图创建开放图故事 - iOS【英文标题】:Creating Open Graph Story with Map - iOS 【发布时间】:2015-05-08 03:59:09 【问题描述】:我想通过我的 ios 应用在 fb 上分享跑步活动。
NSDictionary *properties = @
@"og:type": @"fitness.course",
@"og:title": @"Sample Course",
@"og:description": @"This is a sample course.",
@"fitness:duration:value": @100,
@"fitness:duration:units": @"s",
@"fitness:distance:value": @5,
@"fitness:distance:units": @"km",
@"fitness:speed:value": @5,
@"fitness:speed:units": @"m/s",
@"fitness:metrics:location:latitude": @37.416382,
@"fitness:metrics:location:longitude": @-122.152659,
@"fitness:metrics:location:altitude" :@42,
@"fitness:metrics:timestamp" :@"2011-01-26T00:00",
@"fitness:metrics:distance:value" :@0,
@"fitness:metrics:distance:units":@"mi" ,
@"fitness:metrics:pace:value" :@0,
@"fitness:metrics:pace:units" :@"s/m",
@"fitness:metrics:calories":@0,
;
FBSDKShareOpenGraphObject *object = [FBSDKShareOpenGraphObject objectWithProperties:properties];
FBSDKShareOpenGraphAction *action = [[FBSDKShareOpenGraphAction alloc] init];
action.actionType = @"fitness.runs";
[action setObject:object forKey:@"fitness:course"];
FBSDKShareOpenGraphContent *content = [[FBSDKShareOpenGraphContent alloc] init];
content.action = action;
content.previewPropertyName = @"fitness:course";
我可以使用它在 fb 上分享活动。但现在我想在 fb 帖子的地图视图上添加地理点(与 Nike 应用程序 fb 帖子中的相同)。如何向图形对象添加更多数据点。
【问题讨论】:
【参考方案1】:如果您想添加更多点,请继续按顺序添加。
NSDictionary *properties = @
@"og:type": @"fitness.course",
@"og:title": @"Sample Course",
@"og:description": @"This is a sample course.",
@"fitness:duration:value": @100,
@"fitness:duration:units": @"s",
@"fitness:distance:value": @5,
@"fitness:distance:units": @"km",
@"fitness:speed:value": @5,
@"fitness:speed:units": @"m/s",
@"fitness:metrics:location:latitude": @37.416382,
@"fitness:metrics:location:longitude": @-122.152659,
@"fitness:metrics:location:altitude" :@42,
//Enter point 2
@"fitness:metrics:location:latitude": @xx.xxx,
@"fitness:metrics:location:longitude": @-xxx.xxx,
@"fitness:metrics:location:altitude" :@xx,
//Enter point 3, 4, 5 ...
... ...
@"fitness:metrics:timestamp" :@"2011-01-26T00:00",
@"fitness:metrics:distance:value" :@0,
@"fitness:metrics:distance:units":@"mi" ,
@"fitness:metrics:pace:value" :@0,
@"fitness:metrics:pace:units" :@"s/m",
@"fitness:metrics:calories":@0,
;
https://developers.facebook.com/docs/reference/opengraph/object-type/place
【讨论】:
嗨达伦,我试过这个。但它只显示了起点。 developers.facebook.com/docs/opengraph/guides/fitness 在这个我想完成“处理大型课程对象”。但我无法弄清楚以 iOS 方式进行操作以上是关于使用地图创建开放图故事 - iOS的主要内容,如果未能解决你的问题,请参考以下文章