Facebook に (画像または文字列またはリンク) を投稿するつもりでした。次のコードで投稿しようとすると、自分のウォールにのみ投稿され、友達のウォールには表示されません。
許可 :
「read_stream」、「publish_stream」、「email」、「user_birthday」、「friends_about_me」、「friends_activities」、「friends_likes」。
- (IBAction)fblogin:(id)sender {
AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
getdelegate.facebook.sessionDelegate=self;
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus internetStatus = [reachability currentReachabilityStatus];
if (internetStatus != NotReachable) {
if([getdelegate.facebook isSessionValid])
{
NSLog(@"User already logined with facebook");
}
else
{
[getdelegate.facebook authorize:[NSArray arrayWithObjects:@"read_stream",@"publish_stream",@"email",@"user_birthday",@"friends_about_me",@"friends_activities",@"friends_likes",nil]];
}
}
else
{
NSLog(@"No Internet Connection");
}
}
- (void)fbDidLogin
{
AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
[getdelegate.facebook requestWithGraphPath:@"me" andDelegate:self];
}
- (void) request:(FBRequest*)request didLoad:(id)result
{
AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
if ([result isKindOfClass:[NSDictionary class]])
{
}
}
- (IBAction)Sharebutton:(id)sender
{
AppDelegate *getdelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
NSLog(@"TOKEN:%@",getdelegate.facebook.accessToken);
NSURL *url = [NSURL URLWithString:@"http://www.facebook.com/images/devsite/iphone_connect_btn.jpg"];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img= [[UIImage alloc] initWithData:data];
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:img,@"picture",@"http://www.google.com",@"link",@"Message text",@"message",nil];
[[getdelegate facebook] requestWithGraphPath:@"me/feed"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
}
私は何を間違えましたか?