Returns a Javascript object containing information about your app's canvas page. You need to provide a callback with the API, where we fetch the new value and return it.
Since a Canvas app runs in an iframe it does not have access to window.innerHeight and window.innerWidth. This method exists to provide access to the client (browser) dimensions as well as the current scroll position and offset coordinates.
FB.Canvas.getPageInfo(
function(info) {
alert('Width: ' + info.clientWidth + ' Height: ' + info.clientHeight);
}
);
Name | Type | Description |
---|---|---|
| Integer | The height of the viewport in pixels |
| Integer | The width of the viewport in pixels |
| Integer | The number of pixels between the left edge of the viewport and the left edge of your app's iframe |
| Integer | The number of pixels between the top edge of the viewport and the top edge of your app's iframe |
| Integer | The number of pixels between the left edge of your iframe and the left edge of your iframe's viewport |
| Integer | The number of pixels between the top edge of your iframe and the top edge of your iframe's viewport |
Name | Type | Required | Description |
---|---|---|---|
callback | Function | no | Function called back with the app canvas info. |