当我使用适用于 iOS 的 Facebook SDK 测试我的代码时,我所有的朋友都可以看到我在墙上的所有帖子。出于我所有的测试目的,我希望能够限制帖子。在 Facebook 页面/首选项/应用程序中,我可以设置“以我自己的名义发帖”的可见性。当我将其更改为“只有我”时,将新内容发布到我的墙上不再起作用(->“请求 didFailWithError”)。
此外,在每次将新版本部署到我的 iPad 后,此首选项将重置回默认值。
因此我想问你,是否可以直接在我的 iOS 应用程序中进行设置?谢谢你的帮助。
编辑:
搞不定。当我输出我的请求时,我得到了这个 NSLog:
> Request didLoad: {
> actions = (
> {
> link = "https://www.facebook.com/1608527xxx/posts/3278287008xxx";
> name = Comment;
> },
> {
> link = "https://www.facebook.com/1608527xxx/posts/3278287008xxx";
> name = Like;
> }
> );
> application = {
> id = 274053732670xxx;
> name = "iPad App";
> };
> comments = {
> count = 0;
> };
> "created_time" = "2012-04-17T11:12:46+0000";
> from = {
> id = 160x527xxx;
> name = "MyName";
> };
> icon = "https://s-static.ak.facebook.com/rsrc.php/v1/yzwe/r/StEh3RhPvjk.gif";
> id = "1xx08527xxx_3278287008xxx";
> link = "https://www.facebook.com/photo.php?fxxxxxxxx";
> message = "test caption";
> name = "iPad App Photos";
> "object_id" = 32782867xxxxx;
> picture = "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/xxxxxx70_s.jpg";
> privacy = {
> description = Friends;
> value = "ALL_FRIENDS";
> };
> type = photo;
> "updated_time" = "2012-04-17T11:12:46+0000";
-(void) postPhoto:(UIButton*)button{
UIImage *uploadImage = [UIImage imageNamed:@"testImage"];
NSDictionary *dictPrivacy = [NSDictionary dictionaryWithObjectsAndKeys:@"CUSTOM",@"value", @"SELF", @"friends", nil];
//SBJSON* jsonWriter = [[SBJSON alloc] init];
SBJSON* jsonWriter = [SBJSON new];
NSString* privacyJSONStr = [jsonWriter stringWithObject:dictPrivacy];
NSLog(@"stringPrivacy: %@", privacyJSONStr);
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
uploadImage, @"source",
@"test caption", @"message",
privacyJSONStr, @"privacy",
nil];
[self.facebook requestWithGraphPath:@"/me/photos" andParams:params andHttpMethod:@"POST" andDelegate:(id)self];
}
有什么帮助吗?谢谢(许可状态:)
NSArray *permissions = [[NSArray alloc] initWithObjects: @"read_stream", @"publish_stream", @"user_photos", nil];