Tutorial :Error while trying to retrive the username in an iFrame facebook application



Question:

I am developing a facebook application with iFrame render method. So in order to display my name, I used serverfbml tags. This is my code:

 <fb:serverfbml style="width: 760px;">          <script type="text/fbml">          <fb:fbml>           <fb:name uid='$user_id' useyou='false'></fb:name>          </fb:fbml>         </script>     </fb:serverfbml>  

But The output is " Facebook User". Please explain me why I get this kind of output.

I did an echo of my $user_id, and it displays the id.


Solution:1

According to the specification the default text to display if you can't see the user is Facebook User.

You can specify another text to display with the ifcantsee property like this:

<fb:name uid='$user_id' useyou='false' ifcantsee='Can not see this user'></fb:name>  

The specification says:

Alternate text to display if the logged in user cannot access the user specified. To specify an empty string instead of the default, use ifcantsee="". Default value is Facebook User


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »