简体   繁体   中英

Facebook photo upload not posting photo to wall

OK I can confirm that the session is active. and I can confirm that the token expires on 2012-10-21 so thats not a problem. I can also confirm that the request gets sent to facebook as I reeive a response similar to this:

FBRequest: 0x9138950

Here is where I am sending the facebook request:

- (void)facebookPhotoUpload{
    UIImage *postImage = combinedImage;
    if(combinedImage == nil){
        postImage = badgeImage.image;
    }

    NSLog(@"%@", [appDelegate.facebook expirationDate]);

    NSMutableDictionary* params = [NSMutableDictionary dictionary];
    [params setObject:strMessage forKey:@"message"];
    if (postImage) {
        [params setObject:postImage forKey:@"source"];
        [appDelegate.facebook requestWithGraphPath:@"me/photos" andParams:params
                                     andHttpMethod:@"POST"
                                       andDelegate:self];
    } else { 
        [appDelegate.facebook requestWithGraphPath:@"me/feed" andParams:params
                                     andHttpMethod:@"POST"
                                       andDelegate:self]; }
}

It then gets to this function:

- (void)requestLoading:(FBRequest *)request{
    NSLog(@"Your facebook request is loading... %@", request);
}

and returns with a request memory address. Great so its working that far.

However I get no other response after this...

Has anyone else ever experienced this problem? Does anyone know how to resolve the issue?

The solution is to call your facebookPhotoUpload request on the main thread. Running it on another thread causes it never to get the request to facebook correctly. Also here is another stackoverflow question with the same/similar problem with a deeper explanation as to why this behaviour exists. Facebook request thread problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM