-1

私はiOSでFacebookグラフAPIを使用して、iPhoneからのニュースフィードを共有しています。しかし、次のエラーが発生します。

{com.facebook.sdk:ParsedJSONResponseKey={
body =     {
    error =         {
        code = 2500;
        message = "Unknown path components: /http://newswatch.nationalgeographic.com/2013/01/20/top-25-wild-bird-photographs-of-the-week-34;
        type = OAuthException;
    };
};
code = 400;

}、com.facebook.sdk:HTTPStatusCode = 400}

以下は、btnClickでニュースフィードを共有するための私のコードの一部です。

if ([strType isEqualToString:@"link"]) {


            text = [[resultArrFeed objectAtIndex:selectedIndex] objectForKey:@"caption"];
            if (text == nil) {
                text = [[resultArrFeed objectAtIndex:selectedIndex] objectForKey:@"name"];
            }
            if (text == nil) {
                text = [[resultArrFeed objectAtIndex:selectedIndex] objectForKey:@"story"];
            }
            NSDictionary *dict = [resultArrFeed objectAtIndex:selectedIndex];



            dic=[NSDictionary  dictionaryWithObjectsAndKeys:text,@"message",nil];
            NSLog(@"%@", dict);
           // NSString *str = [dict valueForKey:@"link"];
            NSString *str = [dict valueForKey:@"link"];
            request=[NSMutableString stringWithString: @"me/feed/"];
            [request appendString:str];
             NSLog(@"appended : %@", request);
        }

photoあるタイプのニュースフィードを共有しようとすると、同じコードが機能します。どこが間違っているのですか?この問題を解決するにはどうすればよいですか?

4

1 に答える 1

-1

エラーが発生しました:正しいコード:

if ([strType isEqualToString:@"link"] || [strType isEqualToString:@"video"]) {


            text = [[resultArrFeed objectAtIndex:selectedIndex] objectForKey:@"caption"];
            if (text == nil) {
                text = [[resultArrFeed objectAtIndex:selectedIndex] objectForKey:@"name"];
            }
            if (text == nil) {
                text = [[resultArrFeed objectAtIndex:selectedIndex] objectForKey:@"story"];
            }
            NSDictionary *dict = [resultArrFeed objectAtIndex:selectedIndex];

            NSLog(@"%@", dict);

            NSString *str = [dict valueForKey:@"link"];
            dic=[NSDictionary  dictionaryWithObjectsAndKeys:str,@"link",nil];
            request=[NSMutableString stringWithString: @"me/feed/"];

             NSLog(@" %@", dic);
        }

通過するrequest必要があるだけme/feedparams、通過FBRequest *friendRequest = [FBRequest requestWithGraphPath:request parameters:dic HTTPMethod:@"POST"];する必要がありますlink=http://...

于 2013-01-22T11:19:02.097 に答える