Reputation: 11
I have an iOS app that allows users to post pictures (along with a link, etc.) to their own Facebook feed using the Graph API's me/feed edge.
The images are generated by a PHP script on my server using GD to optimise the image. I would like to serve different images based on whether the feed is being viewed in the Facebook iOS app or on the Facebook website.
I have tried using the HTTP User Agent to detect if a user is viewing the feed item via the FB iOS app or the FB website. However, in both cases, the user agent is set as:
facebookexternalhit/1.1 (*https://www.facebook.com/externalhit_uatext.php*)
Any help on how to achieve this would be highly appreciated.
Cheers
Upvotes: 1
Views: 51
Reputation: 3576
Have you looked at all the request headers for both requests? Any difference you can spot between the two?
Alternatively, you can add a parameter to your own requested url from your iOS app; there you have control over the requested url. On your server you can then detect that parameter and render a different image.
Upvotes: 0