iOS:上传到 Facebook 的照片并不总是上传
我有一个 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", nil];
[appDelegate.facebook requestWithGraphPath:@"/me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:appDelegate];
}
在 FBRequestDelegate 中,即使照片未能出现在 Facebook 个人资料中,也始终会调用 didLoad。所以我的意思是,代码似乎永远不会失败,但照片并不总是出现在 Facebook 个人资料上。
该应用程序是否有可能无法在用户个人资料上创建新相册?我之前在各个小组中看到过其他人报告过这个问题,但从未找到实际的解决方案。谢谢。
I have an iPhone/iPad app that does some basic photo editing and gives the user the option to upload the finished product to Facebook. The app has more than 100,000 users and the majority seem to have no problem uploading their photos to Facebook. However, there are a handful of users that cannot seem to get their photos to upload no matter what they try. I have worked with them to ensure it is not app permissions or Facebook settings blocking them and cannot find any problem there. So I'm wondering if I am doing something incorrectly with FBConnect that is causing the problem to crop up once in a while. Here is the code:
- (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", nil];
[appDelegate.facebook requestWithGraphPath:@"/me/photos"
andParams:params
andHttpMethod:@"POST"
andDelegate:appDelegate];
}
In the FBRequestDelegate the didLoad is always called even when the photo fails to appear in the Facebook profile. So what I'm getting at is the code never seems to fail but the photo doesn't always appear on the Facebook profile.
Is it possible that the app is not able to create a new album on the users profile? I have seen others report this problem before on various groups but have never found an actual solution. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须在权限数组中包含
user_photos
,如下所示:这是所有权限的列表:https://developers.facebook.com/docs/reference/api/permissions/
You have to include
user_photos
in your permissions array like this:Here is the list of all the permissions: https://developers.facebook.com/docs/reference/api/permissions/
Fabecook 分享
Fabecook Sharing