1

在 stackoverflow.com 上搜索 Facebook 开发人员文档/错误和问题后,尚不清楚 Facebook 现在是否支持通过其 iOS SDK 将 publish_actions 发布到时间线。这个网站上有一些与移动设备上的 publish_actions 权限相关的问题,但它们没有提供任何解决方案。

  1. Facebook 是否为所有第三方应用程序推出了针对移动设备的 publish_actions,还是仍仅限于开发人员?
  2. Facebook 是否允许通过 iOS SDK 的 publish_actions 权限将动作发布到时间线?
  3. 是否有任何示例、示例代码或教程来解释如何在 iOS 上实现它?

我会很感激任何指示。

4

3 回答 3

2

是的。在 iOS 中发布操作就像在桌面 Web、移动 Web 和 Android 中一样。

请求 publish_actions 权限的方法与请求任何其他权限的方法相同。

发布操作的方法与您在任何平台上进行的 Graph API 调用相同:

POST https://graph.facebook.com/me/APP_NAMESPACE:ACTION_NAME?OBJECT_NAME=OBJECT_URL&access_token=TOKEN

例如

POST https://graph.facebook.com/me/myapp:cook?recipe=http://exmaple.com/recipe&access_token=TOKEN

在Objective C中你可能有类似的东西

AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithGraphPath:@"me/myapp:cook" andParams:@"http://exmaple.com/recipe" forKey:@"recipe"] andHttpMethod:@"POST" andDelegate:self];
于 2012-03-02T10:21:25.227 回答
0

I cannot make this work. I have already got my action released by Facebook so sample had been sent from CURL, but from IOS I always get back domain error 1000.

Here is my code:

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               @"http://itunes.apple.com/us/app/ginos-challenge/id509946175",@"og.url",
                               @"Played on Gino's challenge",@"og:title",
                               @"http://media.appspy.com/thumbs/images/icons/i509946175_jpg_180x180_q85.jpg",@"og:image",
                               @"This is my first post",@"og:description", 
                               @"1000", @"game_point",
                               nil];

// Publish.
// This is the most important method that you call. It does the actual job, the message posting.
[facebook requestWithGraphPath:@"me/[action domain]:[action name]" andParams:params andHttpMethod:@"POST" andDelegate:self];
于 2012-06-07T16:39:43.883 回答
0

不,publish_action不支持在时间轴上发布。您应该添加一个新标签,例如fb:explicitly_shared. 将此设置为BOOL值。如果设置true,它将显示在用户的时间轴中,否则不会。

于 2013-03-06T08:06:26.163 回答