问题标签 [social-framework]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
2169 浏览

iphone - 如何从 iOS 7 中的 iOS APP 登录 Twitter 帐户?

我需要从我的 iOS 应用程序登录到我的 Twitter。我可以检查设备的设置中是否设置了任何帐户。一旦确认设备中没有配置帐户,我希望能够登录到我的 Twitter 帐户,然后将该帐户添加到我的设备中。在使用 ACAccountStore 检查设备中是否设置了任何帐户时,我有一点运气。但是有人可以帮助在iOS7中实现后面的部分吗?

0 投票
4 回答
3427 浏览

ios - Fetching basic information (id, first_name) from Facebook by using Social Framework - source code and screenshots attached

For what would be a word game later I am trying to fetch very basic information about a player by using Social framework:

  • id
  • first_name
  • gender
  • location

(i.e. nothing sensitive like email and I don't use Facebook iOS SDK).

So in Xcode 5.0.2 I create a blank single view app for iPhone and add Social.framework to the Build phases tab.

Then I add the following code to the ViewController.m:

And create a new Facebook app for which I specify de.afarber.MyFacebook as the iOS Bundle ID:

enter image description here

Finally at Apple iTunes Connect I create a new App ID and then a new app (with a dummy icon and even 2 iPhone screenshots attached):

enter image description here

enter image description here

My Xcode Info tab and the rest of the source code are unchanged:

enter image description here

UPDATE 2:

I have updated the source code as suggested by helpful comments, thank you.

Also, I have another Facebook game, which works well (since 1-2 years) for an Adobe AIR desktop and mobile apps (but now I try to learn native iOS programming) and I have tried its id 262571703638 without success.

And I have added FacebookAppID to MyFacebook-Info.plist as suggested by Mohit10 (it seems to me that it is needed for Facebook SDK only, while I try to use Social Framework - but it can't hurt...)

Now I get the debugger output:

I just need to figure out, how to fetch the id, first_name, gender, location now (and if basic_info is really needed for that)...

0 投票
0 回答
501 浏览

ios - 无法使用 SLComposeViewController 在 Facebook 上共享 PDF URL

我使用 social.framework 为 Titanium Appcelerator 创建了共享模块。以下是我的代码:

我只需要打电话SharePost,它会做所有的事情。这是唯一同时在 Twitter 和 Facebook 上共享的代码。但是当我在 Facebook 上分享一些 URL 时,对话框会正确显示,当我选择 时POST,它会在一些(大约 5)秒后给我错误。出现以下错误

无法发布到 Facebook - 无法发送帖子,因为与 Facebook 的连接失败。

And from that error, the same can be posted successfully when "Try Again" is selected. 我在这里附上了截图。

选择共享选项并将 URL 设置为共享时打开的对话框。

选择发布按钮时的错误消息。

如果你们中的任何人有任何线索,请告诉我。

0 投票
1 回答
5992 浏览

twitter - 在 ios 7 中使用 twitter 登录

我正在做登录功能。其中——

  1. 用户将提供 twitter 电子邮件 ID 以登录,如果登录成功,我的应用程序会将用户导航到我的应用程序的内部屏幕。

  2. 如果用户从用户的设备 ios 设置中配置了 twitter 帐户。我的应用程序从那里获取用户的电子邮件 ID,它将导航到我的应用程序的第二个屏幕。

  3. 如果用户尚未从 ios 设置中配置 twitter 帐户,则如果用户在我的应用程序登录屏幕中点击使用 twitter 登录的按钮,它会将用户导航到用户必须提供电子邮件 ID(twitter id)和密码的 twitter 页面,如果登录成功,它应该返回到我的应用程序的内部屏幕(与使用 facebook 登录的功能相同)。

我怎么能做到这一点。提前致谢。

0 投票
0 回答
223 浏览

ios6 - 从 accountsWithAccountType 得到空数组:在 iPhone

我得到了要执行的代码行-

当我将帐户类型对象传递给accountsWithAccountType:方法时,我得到了一个空数组。当我开始调试此代码时,我得到了以下帐户类型对象的描述。

accountType的打印说明:

标识符:com.apple.twitter

描述:推特

对象ID:x-coredata://C4E0FB79-AAAF-4E87-92AD-C80137717067/AccountType/p25

支持认证 YES

支持MultipleAccounts 是

支持的数据类(空)

同步数据类(空)

我有什么遗漏吗?请帮我解决这个问题。提前致谢。

0 投票
1 回答
673 浏览

ios - 在 iOS 社交框架中使用 Graph API 获取 Facebook 朋友的图片时出错

我正在使用下面的代码来获取 facebook 好友列表,并且它工作正常。但是也需要朋友的头像。

要获取个人资料图片,我已更改请求网址:-

我得到以下回复:-

我不确定它的访问令牌过期错误,因为要将请求 URL 恢复到以前的 URL,代码可以正常工作。

0 投票
1 回答
725 浏览

facebook - 如何从 ACAccount 对象 Social.framework 获取访问令牌

我有一个 iOS 应用程序,用户通过 facebook 或 twitter 登录。我正在使用 social.framework 对用户进行身份验证,我需要将他们的访问令牌发送到服务器以验证他们的凭据。

如果 [NCAccount credential] 总是返回关于苹果文档的空值,我如何获取访问令牌?

https://developer.apple.com/library/ios/documentation/Accounts/Reference/ACAccountClassRef/Reference/Reference.html#//apple_ref/doc/uid/TP40011019

0 投票
2 回答
5961 浏览

ios - 使用社交框架登录并列出 Facebook 好友

有人可以给我一些关于如何整合它的指示吗?我的目标是获取安装了我的应用程序(fb 应用程序)的朋友列表。最初我需要先将用户登录到我的应用程序并列出已经/尚未安装该应用程序的朋友。

PS:我不想使用 Facebook SDK。由于facebook做了无数次更改sdk,我过去做了噩梦。

=========== 更新

我已成功登录并列出我的 Facebook 好友。但是现在列出我的朋友也有这个应用程序和列表图片的问题。我试过这个:

网址:https ://graph.facebook.com/me/friends?friends?fields=id,name,installed,picture

这给了我OAuthException : An active access token must be used to query information about the current user.问题。

我也在API Graph中尝试过,它没有提到错误。

如果我尝试只能me/friends完美运行,它会列出我所有的朋友。

0 投票
1 回答
146 浏览

ios - Facebook 中的应用程序请求,无需在 Social Framework 中重新登录和使用会话

我已经使用 Social Framework 成功连接了 Facebook,还可以获取我的朋友列表。但是,我需要邀请朋友使用我的应用程序,我一直在阅读一些文章和 stackoverflow,这需要使用 Facebook SDK。

现在,我可以使用 Facebook SDK 来实现这一点。但后来我需要重新登录(显示弹出窗口或直接到 FB 应用程序)。我想要的是,使用会话或outhToken我在连接时使用的会话,Social Framework并在 Facebook SDK 中使用它。我知道的,我outhToken已经知道了。如何使用它来传递FBSession或任何类对象来显示应用程序请求?

以下是应用请求示例。

在此处输入图像描述

0 投票
2 回答
989 浏览

ios - 将视频发布到 Facebook 时,必须使用活动访问令牌来查询有关当前用户错误的信息

这是我将视频发布到 Facebook 的代码:

但它的回归:

"OAuth \"Facebook Platform\" \"invalid_request\" \"必须使用活动访问令牌来查询当前用户的信息。\"";

我不知道我错过了什么。有什么帮助吗?