2

I have developed a Facebook app using the C# SDK and it is working fine. Now I want to also enable it on mobiles, so I tried to set the "mobile url" to the same one as my canvas url (which is a cloudapp.net address). However, when I try to access it from a mobile, it seems to go into a redirect loop involving my canvas url, the apps.facebook url and the m.facebook/apps url. Sometimes it goes out of the loop and I get the facebook error message saying : "the mobile version of the app is unavailable because it is misconfigured. It appears to be caught in a redirect loop."

I think it may have to do with the fact that the facebooksettings in the webconfig file specify that my cloudapp page should redirect to the apps.facebook.com page, which then redirects to the mobile url and so on. Can someone tell me how to solve this problem - I just want my mobile url to be the same as my canvas url.

Thanks.

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
Sanorita Rm
  • 155
  • 1
  • 9
  • HI,Thats happening for me as well on the web, it keeps going in to a redirect loop for the code on here http://developers.facebook.com/docs/appsonfacebook/tutorial/ Let me know if you found a solution – pal4life Feb 16 '12 at 23:23
  • Same here. I use a jump url to be able to use custom title and share image. So I share the link to the jump url, that jumps to the facebook app. The problem occurs when the link is opened from the facebook native app on mobile. It opens the url in it's own browser within the facebook app instead of with the native browser app (in my case safari on ios) – Jos Mar 16 '13 at 08:33

1 Answers1

0

If the request is from mobile add extra logic

For v6,

var fb = new FacebookClient();
var desktopLoginUrl = fb.GetLoginUrl(new { .... });
var mobileLoginUrl = fb.GetLoginUrl(new { ...., mobile = true });

For v5,

var urlBuilder = new UrlBuilder(oauthClient.GetLoginUrl(...));
urlBuilder.Host = "m.facebook.com";
var loginUrl = urlBuilder.Uri;
prabir
  • 7,674
  • 4
  • 31
  • 43