Home » July 2012 Breaking Changes

July 2012 Breaking Changes

If you have worked in your advanced settings for your Facebook Apps, you no doubt have seen the Migration items that include the July 2012 Breaking Changes. What is this?

 

Facebook describes this as:

The following changes will go into effect on July 5, 2012:

Removing FB.Canvas.setAutoResizeOriginally scheduled for January 1, 2011
We have renamed FB.Canvas.setAutoResize to FB.Canvas.setAutoGrow so that the method more accurately represents its function. FB.Canvas.setAutoResize will stop working on July 5th. We will completely delete the function on August 1st.

In short it means that the proper code you should use to ensure that lengthy content in your Page App should be the following:

 <div id="fb-root"></div>
    <script>
      window.fbAsyncInit = function() {

        FB.init({
appId: 'YOUR APP ID HERE',
 status: true,
cookie: true,
xfbml: true,
oauth  : true // enable OAuth 2.0
});
FB.Canvas.setAutoGrow();
      };
      (function() {
        var e = document.createElement('script'); e.async = true;
        e.src = document.location.protocol +
          '//connect.facebook.net/en_US/all.js';
        document.getElementById('fb-root').appendChild(e);
      }());
    </script>

The following is the older code which you should no longer be depending on:

<div id="fb-root" style="width:1px;height:1px;position:absolute;"></div>
<script type="text/javascript">
  window.fbAsyncInit = function() {
    FB.init({appId: 'YOUR APP ID HERE', status: true, cookie: true, xfbml: true});
    FB.Canvas.setAutoResize(true,3000);
  };
  (function() {
    var e = document.createElement('script'); e.async = true;
    e.src = document.location.protocol +
      '//connect.facebook.net/en_US/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());
</script>

[via]