0

我遇到的问题是,在用户点击 FBDialog 的“共享”按钮后,在请求完成或失败之前,他们不会得到任何视觉反馈......而且超过 3G 可能需要一段时间。在此期间,用户不知道他们是否正确点击了“分享”,并且存在两次发布内容的风险。

有没有办法我可以获得回调,以便在此期间显示加载指示器?我应该把这块放在哪里?

谢谢!

4

2 回答 2

1

下面的代码你写到 fbAgent.m 和观察代码,你会得到一个“PID”,那时你写来提醒 msg ......用户可以理解这个 msg 是成功发布在 Facebook 上的。

我希望这有帮助。

- (void)request:(FBRequest*)request didLoad:(id)result {
    if ([request.method isEqualToString:@"facebook.fql.query"]) {
        NSArray* users = result;
        NSDictionary* user = [users objectAtIndex:0];
        NSString* name = [user objectForKey:@"name"];

        // Calling the delegate callback
        [delegate facebookAgent:self didLoadName:name];

    } else if ([request.method isEqualToString:@"facebook.users.setStatus"]) {
        newStatus = nil;
        NSString* success = result;
        if ([success isEqualToString:@"1"]) {

            // Calling the delegate callback
            [delegate facebookAgent:self statusChanged:YES];

        } else {
            [delegate facebookAgent:self statusChanged:NO];
        }
    } else if ([request.method isEqualToString:@"facebook.photos.upload"]) {
        NSDictionary* photoInfo = result;
        NSString* pid = [photoInfo objectForKey:@"pid"];
        UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:nil message:[NSString stringWithFormat:@"success Uploaded Your image please check your FaceBook", pid] delegate:self cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
        [alertView show];
        [alertView release];
        fbbut.enabled=YES;
        [fbact stopAnimating];

        self.uploadImageData = nil;
        self.uploadImageCaption = nil;
        self.uploadImageAlbum = nil;
        //[delegate facebookAgent:self photoUploaded:pid];

        if(newStatus){
            [self setStatus:newStatus];
        }
    }
}
于 2011-09-15T09:59:52.957 回答
-1

单击按钮时启动指标并在 Facebook 功能的代表上停止

- (void)dialogDidComplete:(FBDialog *)dialog

希望能帮助到你....

于 2011-08-31T05:55:23.070 回答