你錯過了你的委託一個關鍵點,你必須自己保存會話數據
- (void)fbDidLogin {
// store the access token and expiration date to the user defaults
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:facebook.accessToken forKey:ACCESS_TOKEN_KEY];
[defaults setObject:facebook.expirationDate forKey:EXPIRATION_DATE_KEY];
[defaults synchronize];
}
然後當你初始化的Facebook,你會做以下
facebook = [[Facebook alloc] initWithAppId:kAppId];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
facebook.accessToken = [defaults objectForKey:ACCESS_TOKEN_KEY];
facebook.expirationDate = [defaults objectForKey:EXPIRATION_DATE_KEY];
最後,如果你想發表沒有對話框,你會這樣做
NSString *message = @"Visit my blog http://effectivemobility.blogspot.com/";
NSArray *obj = [NSArray arrayWithObjects:message, nil];
NSArray *keys = [NSArray arrayWithObjects:@"message", nil];
// There are many other params you can use, check the API
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjects:obj forKeys:keys];
[facebook requestWithGraphPath:@"me/feed" andParams:params andHttpMethod:@"POST" andDelegate:nil];
我希望臨時t幫助
嘿,是否有可能分享圖像沒有對話?請儘快恢復 – Abha 2017-12-28 06:44:25