gpt4 book ai didi

ios - Facebook 在 iOS 上不显示 map

转载 作者:行者123 更新时间:2023-11-30 14:06:17 26 4
gpt4 key购买 nike

我尝试使用 facebook opengraph 显示 map 。所以我有一个 Facebook 故事 enter image description here

以及具有属性的对象类型 enter image description here

在我的代码中我创建对象

            var properties:NSDictionary = ["og:type": "myplanetnamespace:plan", "og:title": "Share on Facebook выа", "og:description": "In the frozen wastes to the north of Winterfell, sinister and supernatural forces are mustering.",
"myplanetnamespace:geoplace:latitude": String(stringInterpolationSegment: self.plan.venue!.location.latitude),
"myplanetnamespace:geoplace:longitude": String(stringInterpolationSegment: self.plan.venue!.location.longitude) ]
var object:FBSDKShareOpenGraphObject = FBSDKShareOpenGraphObject(properties: properties as [NSObject : AnyObject])

和行动

    var action = FBSDKShareOpenGraphAction()
action.actionType = "myplanetnamespace:create_plan"
action.setObject(object, forKey: "plan")

以及内容

    var content:FBSDKShareOpenGraphContent = FBSDKShareOpenGraphContent()
content.action = action
content.previewPropertyName = "plan"

还有对话框

 var shareDialog = FBSDKShareDialog()
shareDialog.fromViewController = self
shareDialog.shareContent = content
if ( shareDialog.canShow() == true ){
shareDialog.show()
}
var error:NSError?
if(!shareDialog.validateWithError(&error)){
print ("error")
}

我按照要求设置了位置属性,没有错误。我试图发表一篇文章,但它在没有任何 map 的情况下创建它 =((

最佳答案

geoplace 来自哪里?这不是 Facebook Open Graph 的一部分,是吗?你能做这样的事情吗:

[openGraphObject setObject:@{@"latitude": String(stringInterpolationSegment: self.plan.venue!.location.latitude), 
@"longitude": String(stringInterpolationSegment: self.plan.venue!.location.longitude)]}
forKey:@"location"];

关于ios - Facebook 在 iOS 上不显示 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32356723/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com