showAuthenticationDialogを使用するspotifyアプリを作成しています-ユーザーをFacebookの友達に招待するためのダイアログ。
招待は機能しますが、ポップアップ-WindowsはWindowsでは閉じません(Macでは閉じます!)。
コードは次のようになります。
var redir = "https://server/services/callback/facebook/apprequest/?source=spotify&user_id=" + uID;
var data = "user_id=" + session.otheruser.id;
var url = "http://www.facebook.com/dialog/apprequests?app_id=" + FB_APP_ID + "&message=" + encodeURIComponent( msg ) + "&redirect_uri=" + encodeURIComponent( redir ) + "&display=popup&data=" + encodeURIComponent( data );
auth.showAuthenticationDialog(url, 'http://moosify.com', {
onSuccess : function(response) {
console.log("Success! Here's the response URL: " + response);
},
onFailure : function(error) {
console.log("Authentication failed with error: " + error);
},
onComplete : function() { }
});
サーバーは実際にはサーバーのURLです。(これはmanifest.jsonにあります)