我正在使用FB API并集成FB,以便当他们接受时我会在用户墙上发帖,
我的代码远离fb网站,它的工作一切正常,但用户可以在邮箱上输入自己的信息。
- (void)fbDidLogin {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:[facebook accessToken] forKey:@"FBAccessTokenKey"];
[defaults setObject:[facebook expirationDate] forKey:@"FBExpirationDateKey"];
[defaults synchronize];
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"user_likes",
@"read_stream",
nil];
[facebook authorize:permissions];
[permissions release];
[facebook dialog:@"feed" andDelegate:self];
}
我想知道我是否可以在框中显示预设信息,例如下面的代码。
[NSString stringWithFormat:@" My New High Score i%",highscore]
并锁定,以便他们无法编辑它。
答案 0 :(得分:0)
我发现通过使用它发布了我需要的所有内容,并允许用户添加评论加上他们无法编辑高分,这就是我想要的。
- (void)postwall
{
NSString *string = @"I reached a score of ";
string = [string stringByAppendingString:[NSString stringWithFormat:@"%d", highscore]];
string = [string stringByAppendingString:@" can you beat me?"];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
//kAppId, @"app_id",
@"https://developers.facebook.com/docs/reference/dialogs/", @"link",
@"http://fbrell.com/f8.jpg", @"picture",
@"Watch Ma Balls", @"name",
@"How long can you keep out of the way of ma balls for", @"caption",
string, @"description",
nil];
[facebook dialog:@"feed" andParams:params andDelegate:self];
}