Facebook Platform for Mobile: XHTML
From Facebook Developer Wiki
Mobile applications can integrate into Facebook's XHTML website (m.facebook.com) in the form of profile boxes and mobile canvas pages. These applications act like a hybrid between a Facebook desktop application and a canvas page application, as they share similar traits and functionality of each of them.
In general, a mobile application that integrates XHTML is a subset of a canvas page application, as mobile clients cannot display the same amount of rich content that canvas pages can as they can't run JavaScript or render every FBML tag.
The fb:mobile FBML tag provides integration into the mobile XHTML version of the Facebook website (http://m.facebook.com).
Contents |
XHTML Profile Pages
The mobile site features a limited version of the profile page, designed for optimized viewing on a mobile device. Applications may integrate into this profile via use of the fb:mobile tag.
When evaluating profile FBML, any content inside a fb:mobile tag will be rendered exclusively on m.facebook.com. This content will not be displayed on the regular site. Further, profile content outside of the fb:mobile tag will not be displayed on the mobile site.
XHTML Canvas Pages
Facebook enables application developers using FBML to build pages optimized for the mobile device by signaling when a mobile device may be in use and providing the option for the application developer to use an XHTML frame.
In order to use an XHTML frame instead of the standard Facebook frame, an application implementing canvas pages in FBML should wrap the canvas page FBML in opening and closing fb:mobile tags. The fb:mobile tag must be the outermost tag in the FBML markup. When this is specified, the mobile XHTML frame is used, visually consistent with the m.facebook.com site. Check out the list of allowed HTML and FBML tags.
In order to help developers identify when a mobile device may be in use, Facebook may optionally send an additional header with the canvas page request. When Facebook recognizes a browser agent likely to be mobile, a POST parameter fb_sig_mobile is sent with a value of 1. Note that this is purely informative. Control over which frame is used is left up to the developer. The application may choose to ignore the fb_sig_mobile parameter, and the normal frame will be used. Similarly, applications are also free to use the fb:mobile tag even when Facebook has not identified the agent as a mobile device.
XHTML Best Practices
In order to guarantee proper rendering on mobile devices with limited processing/bandwidth capability and/or alternate browser implementations, content inside the fb:mobile tag is limited to a subset of the full FBML markup. Most notably, all FBJS and Mock AJAX constructs are unavailable.
Mobile applications should avoid heavy use of images, tables, and advanced CSS. The Openwave XHTML Mobile Profile documentation is available for consultation and examples at http://developer.openwave.com/documentation/xhtml_mp_css_reference/.
The developer FBML test console can be used to test rendering of fb:mobile content. Note that the fb:mobile tag must be included when using the test console in mobile mode. Content outside of fb:mobile will not be rendered, as previously described.
