开发者

Broken (grey) thumbnails in Facebook mobile feed?

开发者 https://www.devze.com 2023-04-06 04:20 出处:网络
I have an iOS app that posts to users FB feeds with a link, description, and image. If I check posts that have been made through my app in a full sized browser, I can see that everything, including t

I have an iOS app that posts to users FB feeds with a link, description, and image.

If I check posts that have been made through my app in a full sized browser, I can see that everything, including the thumbnail is showing as expected.

Broken (grey) thumbnails in Facebook mobile feed?

The problem is if I open the FB feed from a mobile browser or the FB iOS app, I get grey boxes instead of thumbnails.

Broken (grey) thumbnails in Facebook mobile feed?

I have tried this multiple times and I get the grey box in mobile pages every single time and all of the Facebook debug data for the link checks out as far as I can see.

Broken (grey) thumbnails in Facebook mobile feed?

The following is the objective-c code that posts the Feed to FB.

NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
[params setObject:self.captionTextView.text forKey:@"message"];

[params setObject:[NSString stringWithFormat:@"%@'s photo on Wander", [开发者_开发知识库appDelegate.prefs valueForKey:@"firstName"]] forKey:@"name"];
[params setObject:shortUrl forKey:@"link"];

NSString *imageURL = [NSString stringWithFormat:@"http://%@/mobile/photo.php?p=%@", appDelegate.apiHost, photoParams];

[params setObject:imageURL forKey:@"picture"];

[params setObject:[NSString stringWithFormat:@"%@, %@", [appDelegate.prefs valueForKey:@"cityName"], [appDelegate.prefs valueForKey:@"countryName"]] forKey:@"caption"];

[params setObject:[NSString stringWithFormat:@"I'm using Wander to explore %@ with %@ as a local guide!", [matchData valueForKey:@"cityName"], [matchData valueForKey:@"firstName"]] forKey:@"description"];

[appDelegate.facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/feed", fbId] andParams:params andHttpMethod:@"POST" andDelegate:self];
[params release];

This is the test URL: http://maruta.wanderwith.us/viewPhoto/index/My0zNA (this might disappear because it's on a development server and I regularly clear data, I'll try my best to keep it live until this gets resolved)

Am I missing something?


I ran into the same situation. Turns out it was the question mark in your URL. Facebook passes your image URL through their own proxy. If your URL contains "?", then it doesn't work through the mobile feed somehow.

Your server expects url in this format: http://hostname/mobile/photo.php?p=1234567889. If you change this to this format: http://hostname/mobile/photo/1234567889, then Facebook will be happy. try mod rewrite if you are using apache.

0

精彩评论

暂无评论...
验证码 换一张
取 消