I'm using following script for login using Facebook JavaScript API.
var permissions = [
'email',
'user_friends'
].join(',');
FB.login(function (response) {
// if login was successful, execute the following code
if (response.authResponse) {
//Perform next set of methods
}
}, {scope: permissions});
This is working in all browsers and in Android (this script is rendering inside an iframe).
But when a user open the login page in Facebook In-app browser for iOS, then the login is not working. Popup is not showing.
After spending some time to fix this, the issue is happening only when I include the login page in an iframe.
Anyone experienced the same issue?
I experienced this issue. You need to use FB.getLoginStatus
then if the user is not logged in, use FB.login
. Just make sure to call FB.login
after user click or else you will get a popup blocked.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.