使用带有地图附件的Facebook Open Graph Story(GeoPoint) [英] Using Facebook Open Graph Story with map attachment (GeoPoint)
问题描述
我正在尝试使用iOS SDK创建一些带有地图附件的Open Graph Story,我有一些问题。
I'm trying to create some Open Graph Story with map attachment using iOS SDK and I'm have some issues.
首先我有对象创建的问题...我设置了一个继承自Place的对象。所以这里是第一个问题如何使用iOS Facebook SDK设置GeoPoint属性?经过这么多尝试后,我放弃了...所以我创建了一个继承自Object的对象,并创建了一个自定义属性命名为位置作为GeoPoint。但是这个解决方案给我带来了同样的问题:如何使用iOS Facebook SDK设置GeoPoint属性?
First of all I'm having issues with the object creation... I had set a object that inherits from 'Place'. So here is the first question "how to setup a GeoPoint property using iOS Facebook SDK?"... After so many tries, I gave up... So I created a object that inherist from 'Object' and I created a custom property named 'location' as GeoPoint. But this solution brings me to same question "how to setup a GeoPoint property using iOS Facebook SDK?"
我需要的是创建一个带有显示场地位置的地图的故事。
All I need is create a Story with a map that shows the venue location.
这是我的对象:
id<FBOpenGraphObject> openGraphObject = (id<FBOpenGraphObject>)[FBGraphObject openGraphObjectForPost];
[openGraphObject setType:@"appnamespace:venue"];
[openGraphObject setTitle:[currentVenue name]];
[openGraphObject setObject:@"en_US" forKey:@"og:locale"];
[openGraphObject setObject:[[currentVenue locationLatitude] stringValue] forKey:@"appnamespace:location:latitude"];
[openGraphObject setObject:[[currentVenue locationLongitude] stringValue] forKey:@"appnamespace:location:longitude"];
但不行。
它出现在Facebook浏览器对象中,但仅显示名称。其他属性为零。
It appears in Facebook Browser Objects, but with only the name. The other properties are nil.
有人可以帮助我吗?
推荐答案
需要以你的appnamespace为前缀,并且每个':'意味着一个新的对象或字典。
The properties don't need to be prefixed by your appnamespace, and each ':' implies a new object or dictionary.
尝试一下:
[openGraphObject setObject:@{@"latitude": [currentVenue locationLatitude],
@"longitude": [currentVenue locationLongitude]}
forKey:@"location"];
这篇关于使用带有地图附件的Facebook Open Graph Story(GeoPoint)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!