在iOS 6中,检查一个人是否登录到社交网络? [英] In iOS 6, check if a person is logged in to a social network?

查看:125
本文介绍了在iOS 6中,检查一个人是否登录到社交网络?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想要这样做的原因是要下降在应用程序中通过例如使用Facebooks SDK来共享应用程序,而不是要求用户再次登录。



我其实认为代码:

  [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]; 

完全是这样,但显然只有当用户没有登录时,才会显示警报。 p>

只有当用户没有安装Facebook应用程序,没有登录到操作系统(在设置中)时才会发生,但是通过Facebook登录到我们的应用程序

解决方案

您在设备上对我有用的功能:

  if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]){//仅对登录的fb用户执行某些操作} else {//为非fb用户执行其他操作} 

您是在设备或模拟器上尝试吗?


Is there a way to check if a user actually is logged in to facebook or twitter in the operating system.

The reason I want to do this is to fall back on sharing in the application by for example using facebooks SDK instead to share, without asking the user to log in again.

I actually thought that the code:

[SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook];

did exactly that, but apparently it only shows an alert if the user has not logged in.

This only occurs when the user does not have the Facebook app installed, is not logged in the operating system (in the settings), but is logged in to our application through the Facebook SDK.

解决方案

What you have works for me on device:

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {// do something only for logged in fb users} else {//do something else for non-fb users}

Are you trying on device or simulator?

这篇关于在iOS 6中,检查一个人是否登录到社交网络?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆