我想为ios 5和ios 6集成Facebook。
我知道在个人ios (即iOS5或iOS6)中集成facebook的知识,但不知道如何在iOS5和iOS6中支持facebook。
换句话说,如何在ios 5和ios 6上集成facebook?或者,在两个ios中支持这一点的通用方法是什么?
谢谢
发布于 2012-12-28 13:27:44
如果你想在iOS6中使用facebook集成,如果iOS版本低于6,你想使用iOS的Facebook SDK,你可以在Social Framework中检查集成的Facebook服务类的可用性。此外,您还必须为它导入Social Framework。
#import<Social/Social.h>您可以通过buttonAction方法中的类似内容来检查集成的facebook服务的可用性
- (void)buttonAction:(id)sender
{
//Check for availability of Facebook integration and use its view controller to share on Facebook
if(NSClassFromString(@"SLComposeViewController") != nil) {
SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
//Use fbController for sharing
} else {
// Service not available
}
}
else{
// Use your code for sharing on iOS versions other than 6.x to authenticate and get an access token.
}
}希望这能帮上忙。
发布于 2012-12-28 15:21:06
发布于 2013-07-10 17:05:40
如果您使用的是xcode 4.5或更高版本。使用社交框架,你可以在iOS上实现Facebook。另请检查iPhone tutorial.Visit http://kmithi.blogspot.co.uk/2012/10/integrating-facebook-and-twitter-in-ios.html的FB和Twitter集成
https://stackoverflow.com/questions/14064899
复制相似问题