I am currently developing a Facebook IFrame App and have implemented the following javascript code to prompt users to log in and grant necessary permissions for the application. Once they do this, they should be redirected to the iframe app successfully. The code is functioning as expected, however, there are two issues that I am facing.
a. Upon loading the app in the IFrame, it redirects to a page () displaying a large facebook icon. Clicking on this icon redirects me to the facebook login page. I would like my app to directly redirect to the login page without the intermediate facebook icon page.
b. When the user clicks on the 'Allow' button to grant permission within facebook, the page redirects to my main site () instead of the specified iframe application URL ().
Below is the snippet of javascript code that I am using, despite the aforementioned quirks.
var api_key = 'xxxxxxxxxxxxxxx';
var channel_path = 'xd_receiver.htm';
FB_RequireFeatures(["Api"], function () {
FB.Facebook.init(api_key, channel_path);
var api = FB.Facebook.apiClient;
// require user to login
api.requireLogin(function (exception) {
FB.Connect.showPermissionDialog("publish_stream");
});
});
Your assistance in resolving these issues would be greatly appreciated.