Quantcast
Viewing all articles
Browse latest Browse all 8068

Webview with facebook or twitter JS SDK causes white page on iOS

Our app uses some webviews which show some pages of our mobile website. Always worked fine until now. Pages didn't load anymore; they would give a flash of the content, but then turned white.

After removing all lines of code I ended up with some javascript code (twitter and facebook share buttons and the SDK initialisation code that is required. This was the cause; when I removed it the page loads fine again.

This is the code:

<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=XXXXXXXX";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
Platform: iOS SDK: 3.2.1 (also tested on latest build from THU JAN 30, 2014)

Anyone got a clue?


Viewing all articles
Browse latest Browse all 8068

Trending Articles