IEとiPhoneを含むSafariで、Facebookアプリでログインセッションを受け取れず(getSessionがNULL)、iFrameの中が無限reloadされる不具合への対策です。
gitサンプルコードの問題なんだが、あまりに情報がなくて苦労しましたよ。
IE対策は
1 |
header('p3p: CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'); |
といったHTTPヘッダを出力するのみ。この際、IEはすべてRejectしてやりたい気持ちを抑えつつ(^^;
◆情報元
http://forum.developers.facebook.net/viewtopic.php?id=73645
そしてSafari対策はgitのサンプルにあるFB.Event.subscribe(‘auth.login’, function() を以下に差し替え。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
FB.Event.subscribe('auth.login', function(response) { if(navigator.userAgent.toLowerCase().indexOf("safari") > -1) { if (response.session) { $('body').prepend("<form id='safariFix'></form>"); $('#safariFix') .attr('method', 'POST') .attr('action', location.href) .append('<input type="hidden" name="session" id="safariFix_session" />'); $('#safariFix_session').attr('value', JSON.stringify(response.session)); $('#safariFix').submit(); } } else { window.location.reload(); // Whenever the user logs in, we refresh the page } }); |
◆情報元
http://forum.developers.facebook.net/viewtopic.php?id=73645
Syntax Highlighter ComPressプラグインを入れました!
あと前に入れたまま放置していたCCライセンスのイメージ写真を引用できるプラグインを使ってみました。
No comments yet. You should be kind and add one!
By submitting a comment you grant typista a perpetual license to reproduce your words and name/web site in attribution. Inappropriate and irrelevant comments will be removed at an admin’s discretion. Your email is used for verification purposes only, it will never be shared.