1

を使用して、友人の壁の 1 つにテキストと写真を投稿したいと考えていFBDialogます。私はこのような方法を持っています

 - (void)apiDialogFeedFriend:(NSString *)friendID :(NSString *)mImageSTR{
    currentAPICall = kDialogFeedFriend;
    FBSBJSON *jsonWriter = [FBSBJSON new];

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               friendID, @"to",
                               @"I'm using the Hackbook for iOS app", @"name",
                               @"Hackbook for iOS.", @"caption",
                               @"Check out Hackbook for iOS to learn how you can make your iOS apps social using Facebook Platform.", @"description",
                               @"http://m.facebook.com/apps/hackbookios/", @"link",
                               @"http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png", @"picture",
                               actionLinksStr, @"actions",
                               nil];

    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
    [[delegate facebook] dialog:@"feed"
                      andParams:params
                    andDelegate:self];

}

これらを通じて、のdialogCompleteWithUrlメソッドへのコールバックを取得しますFBDialogDelegate。このデリゲート メソッドを次のように実装しました。

    - (void)dialogCompleteWithUrl:(NSURL *)url {
 if (![url query]) {
        return;
    }

    NSDictionary *params = [self parseURLParams:[url query]];
    switch (currentAPICall) {
        case kDialogFeedUser:
        case kDialogFeedFriend:
        {
            // Successful posts return a post_id
            if ([params valueForKey:@"post_id"]) {
                [self showMessage:@"Published feed successfully."];
                NSLog(@"Feed post ID: %@", [params valueForKey:@"post_id"]);
            }
            break;
        }
        case kDialogRequestsSendToMany:
        case kDialogRequestsSendToSelect:
        case kDialogRequestsSendToTarget:
        {
            // Successful requests return the id of the request
            // and ids of recipients.
            NSMutableArray *recipientIDs = [[NSMutableArray alloc] init];
            for (NSString *paramKey in params) {
                if ([paramKey hasPrefix:@"to["]) {
                    [recipientIDs addObject:[params objectForKey:paramKey]];
                }
            }
            if ([params objectForKey:@"request"]){
                NSLog(@"Request ID: %@", [params objectForKey:@"request"]);
            }
            if ([recipientIDs count] > 0) {
                [self showMessage:@"Sent request successfully."];
                NSLog(@"Recipient ID(s): %@", recipientIDs);
            }
            break;
        }
        default:
            break;
    }
}

ここで、url の正しい値を として取得しますfbconnect://success?post_id=100001402819851_418640698226650

今、私の問題は、友人の壁で私の投稿が表示されない/表示されないことです。

どんな助けでも大歓迎です。

4

0 に答える 0