我有一个iPhone/iPad应用程序,可以进行一些基本的照片编辑,并为用户提供将成品上传到Facebook的选项.该应用程序拥有超过100,000名用户,而且大多数人似乎都没有将照片上传到Facebook的问题.但是,有少数用户无论他们尝试什么,似乎都无法上传他们的照片.我与他们合作,以确保它不是应用程序权限或Facebook设置阻止他们,并在那里找不到任何问题.所以我想知道我是否正在使用FBConnect做错误导致问题偶尔出现.这是代码:
- (void)initFacebook {
if( self.facebook == nil ) {
Facebook *fb = [[Facebook alloc] init];
self.facebook = fb;
[fb release];
}
if( [self.facebook isSessionValid] ) {
[[NSNotificationCenter defaultCenter] postNotificationName:@"FacebookIsReady"
object:nil
userInfo:nil];
} else {
NSArray *perms = [NSArray arrayWithObjects:@"publish_stream", @"user_likes", nil];
[self.facebook authorize:MY_FB_APP_ID permissions:perms delegate:self];
}
}
-(void)fbDidLogin {
[[NSNotificationCenter defaultCenter] postNotificationName:@"FacebookIsReady"
object:nil
userInfo:nil];
}
// this is in a different class
- (void)facebookIsReady:(NSNotification *)notification {
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:self.theImage, @"source", …Run Code Online (Sandbox Code Playgroud)