[英]Facebook integration for ios 5 & ios 6
我想將ios 5和ios 6整合在一起。
我知道將facebook整合到個人ios(即ios 5或ios 6)中,但不知道如何支持ios 5和ios 6的facebook。
換句話說,如何為ios 5和ios 6整合facebook? 或者在兩個ios中支持這個的常用方法是什么?
謝謝
好吧,如果你想在iOS6中使用facebook集成,如果iOS版本低於6,你想使用Facebook SDK for iOS,你可以檢查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.
}
}
希望它有所幫助。
如果你有xcode 4.5或更高版本。 使用社交框架,您可以在iOS上實現Facebook。 同時檢查FB和Twitter集成的iPhone教程。訪問http://kmithi.blogspot.co.uk/2012/10/integrating-facebook-and-twitter-in-ios.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.