user1219601
user1219601

Reputation: 1

FB.ui renders iFrame inside my app iFrame

When i try to render a dialogue for asking user to post on his wall, the dialogue iframe is rendered inside my application iFrame, which hides half of the dialogue :(

You can find screenshot here http://img59.imageshack.us/img59/3076/dialogueq.jpg

Normally it should appear as a lightbox and should be rendered outside the application iFrame.

 FB.ui(
 {
  method: 'feed',
  message: 'Gain points and prizes with '+pageName ,
  name: 'Visit our mobile community',
  caption: pageName,
  description: desc,
  link:  'http://mydomain.com/generateLink?pageId='+pageId,
  picture: 'http://mydomain.com/public/img/Logo.png',
  user_message_prompt: 'Share your thoughts about '+ pageName +' and gain points.'
 },
 function(response) {
    postedOnFb = true;
   if (response && response.post_id) {
   }
 }
);

Anybody who has faced similar issue?

Thanks in advance

Upvotes: 0

Views: 791

Answers (1)

Nitzan Tomer
Nitzan Tomer

Reputation: 164129

All of the facebook ui experience that is provided by the facbook js sdk is rendered inside an iframe. Since this is meant to be used in both canvas pages and websites alike, it does not take into account the fact that your page is inside facebook. More than that, there would probably be some security issues if it was trying to do that, and if it worked it could provide a nice opportunity for people to do XSS.

Since your application is inside a page, and also looks like you are using a screen with small resolution, I suggest that you try to display this dialog in its pop-up version. I agree, it's not as slick but hey, at least the users will be able to see all of it.

To open the dialog in a pop-up, specify the "display" parameter, like this:

FB.ui(
 {
  method: 'feed',
  display: 'popup',
  message: 'Gain points and prizes with '+pageName ,
  name: 'Visit our mobile community',
  caption: pageName,
  description: desc,
  link:  'http://mydomain.com/generateLink?pageId='+pageId,
  picture: 'http://mydomain.com/public/img/Logo.png',
  user_message_prompt: 'Share your thoughts about '+ pageName +' and gain points.'
 },
 function(response) {
    postedOnFb = true;
   if (response && response.post_id) {
   }
 }
);

You can read about it more here: http://developers.facebook.com/docs/reference/javascript/FB.ui/

Upvotes: 1

Related Questions