Facebook SDK: post to wall only visible for me for testing purposes?
when i test my code using the Facebook SDK for iOS, all my post to my wall are visible for all my friends. For all my testing purposes, i want to be able to restrict the postings. Within the Facebook page/preferences/Applications, i´m able to set the visibility for "post within my own name". When i change that to "only me", posting new content to my wall don´t work anymore (-> "Request didFailWithError").
Furthermore this preference will be reseted back to the default, after each deploy of a new build to my iPad.
Therefore i want to ask you, if there´s the ability to set it directly within my iOS app? Thanks for your help.
EDIT:
Can´t get it done. When i output my request, i get this 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];
}
Any help on that? Thanks (Permission state:)
NSArray *permissions = [[NSArray alloc] initWithObjects: @"read_stream", @"publish_stream", @"user_photos", nil];
I normally just use a test user on facebook with no friends. works for me!
You can set a privacy for each post you are doing from your iOS App. Refer this page with a keyword "privacy".
https://developers.facebook.com/docs/reference/api/post/
有一个用于创建测试用户的API,Facebook支持每个应用程序最多500个测试用户:http://developers.facebook.com/docs/test_users/
链接地址: http://www.djcxy.com/p/83132.html上一篇: 无法获得Facebook发布