我已經使用FAcebook SDK 3.0集成Facebook。我有使用示例代碼「HelloFacebookSample」 發佈狀態。 我用AppId更改了Info.plist文件。 我有問題,顯示armv7s,armv7架構problem.I甚至通過「構建活動架構只有」到YE解決。facebook與iPhone的Facebook集成與Facebook的SDK的iOS 5和6
我有代碼,顯示登錄/註銷按鈕爲Facebook
#import "HFViewController.h"
#import "AppDelegate.h"
#import <CoreLocation/CoreLocation.h>
@interface HFViewController() <FBLoginViewDelegate>
@property (strong, nonatomic) IBOutlet UIButton *buttonPostStatus;
@property (strong, nonatomic) id<FBGraphUser> loggedInUser;
- (IBAction)postStatusUpdateClick:(UIButton *)sender;
- (void)showAlert:(NSString *)message
result:(id)result
error:(NSError *)error;
@end
@implementation HFViewController
@synthesize shareStringFb;
@synthesize buttonPostStatus = _buttonPostStatus;
@synthesize loggedInUser = _loggedInUser;
- (void)viewDidLoad {
[super viewDidLoad];
// Create Login View so that the app will be granted "status_update" permission.
self.buttonPostStatus.enabled = YES;
FBLoginView *loginview = [[FBLoginView alloc] init];
loginview.frame = CGRectOffset(loginview.frame, 5, 5);
loginview.delegate = self;
[self.view addSubview:loginview];
[loginview sizeToFit];
statusText.text=self.shareStringFb;
{
// if the session is closed, then we open it here, and establish a handler for state changes
}
}
-(IBAction)backClick:(id)sender
{
[self.view removeFromSuperview];
}
- (void)viewDidUnload {
self.buttonPostStatus = nil;
self.loggedInUser = nil;
[super viewDidUnload];
}
- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView {
// first get the buttons set for login mode
self.buttonPostStatus.enabled = YES;
}
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
user:(id<FBGraphUser>)user {
// here we use helper properties of FBGraphUser to dot-through to first_name and
// id properties of the json response from the server; alternatively we could use
// NSDictionary methods such as objectForKey to get values from the my json object
self.loggedInUser = user;
}
- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
self.buttonPostStatus.enabled = NO;
}
//發佈狀態更新按鈕處理 - (IBAction爲)postStatusUpdateClick:(UIButton的*)發件人{
// Post a status update to the user's feed via the Graph API, and display an alert view
// with the results or an error.
NSString *message = [NSString stringWithFormat:@"Updating %@'s status at %@",
self.loggedInUser.first_name, [NSDate date]];
[FBRequestConnection startForPostStatusUpdate:self.shareStringFb
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
[self showAlert:message result:result error:error];
self.buttonPostStatus.enabled = YES;
}];
self.buttonPostStatus.enabled = NO;
}
//發佈圖片按鈕處理程序
它顯示一個按鈕與模擬器中的登錄/註銷,但是當我在設備中測試它不顯示該按鈕。
請問任何人都可以告訴我什麼是問題?爲什麼它沒有顯示出來?是否有其他方法可以將Fb集成到ios 5和6中。
對於iOS6的存在對於Facebook集成內置功能。 .. – Vishal
你一定需要發佈更多的代碼才能幫助你。 – jakenberg
@jinal嘿親愛的vishal說的是正確的..在這裏你可以得到像ios5的Twitter的Facebook的inbult框架,你能接受我給你的答案嗎? –