OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Why does FB SDK login with permissions gives UI issue? Like, buttons hide

  • Thread starter Thread starter Sufian Ahmad
  • Start date Start date
S

Sufian Ahmad

Guest
My app allow users to integrate their FB account and users can manage their pages. But when user try to connect and login modal opens by facebook. Then the continuer button at the bottom hides.

Using "react-native": "0.68.2", "react-native-fbsdk-next": "^11.1.0"

My code: LoginManager.logInWithPermissions(FBPermissionsArray) .then( login => { if (login?.isCancelled) { console.log('Login cancelled');

Code:
                    setloading(false)
                    
                    showMessage({
                        message: "Facebook login cancelled",
                        duration: 5000,
                        statusBarHeight: 0,
                        titleStyle: { lineHeight: hp('2%'), fontSize: RFValue(14) },
                        type: 'warning'
                    })
                } else {
                    AccessToken.getCurrentAccessToken().then(data => {
                        console.log('device token data>>>>>', data);

                        const accessToken = data?.accessToken.toString();
                        getInfoFromToken(accessToken, loaderValue);
                    });
                }
            },
            error => {
                console.log('Login fail with error: ' + error);
                
                setloading(false)
                
                showMessage({
                    message: "Facebook login failed. Please try again",
                    duration: 5000,
                    statusBarHeight: 0,
                    titleStyle: { lineHeight: hp('2%'), fontSize: RFValue(14) },
                    type: 'warning'
                })
            },
        );

const FBPermissionsArray = [ 'public_profile', 'pages_show_list', 'pages_manage_ads', 'pages_read_engagement', 'leads_retrieval', 'ads_management', 'pages_manage_metadata', 'business_management' ]

I tried to search this issue on internet but I found nothing. I tried to delete my app, disconnect FB account from app and again connect it but this issue still exist.

For now, the soultion is to delete FB app and when integrate with FB via my app. User needs to enter credentials in the modal (webview). Then in the webview, the buttons won't hide. But it's not a valid solution, why would user delete his/her FB app.

In the previous version of FB SDK, the buttons won't hide but the UI in the new version (that updates automatically) is disturbed.

enter image description here

enter image description here
<p>My app allow users to integrate their FB account and users can manage their pages.
But when user try to connect and login modal opens by facebook. Then the continuer button at the bottom hides.</p>
<p><strong>Using</strong>
"react-native": "0.68.2",
"react-native-fbsdk-next": "^11.1.0"</p>
<p><strong>My code:</strong>
LoginManager.logInWithPermissions(FBPermissionsArray)
.then(
login => {
if (login?.isCancelled) {
console.log('Login cancelled');</p>
<pre><code> setloading(false)

showMessage({
message: "Facebook login cancelled",
duration: 5000,
statusBarHeight: 0,
titleStyle: { lineHeight: hp('2%'), fontSize: RFValue(14) },
type: 'warning'
})
} else {
AccessToken.getCurrentAccessToken().then(data => {
console.log('device token data>>>>>', data);

const accessToken = data?.accessToken.toString();
getInfoFromToken(accessToken, loaderValue);
});
}
},
error => {
console.log('Login fail with error: ' + error);

setloading(false)

showMessage({
message: "Facebook login failed. Please try again",
duration: 5000,
statusBarHeight: 0,
titleStyle: { lineHeight: hp('2%'), fontSize: RFValue(14) },
type: 'warning'
})
},
);
</code></pre>
<p>const FBPermissionsArray = [
'public_profile',
'pages_show_list',
'pages_manage_ads',
'pages_read_engagement',
'leads_retrieval',
'ads_management',
'pages_manage_metadata',
'business_management'
]</p>
<p>I tried to search this issue on internet but I found nothing. I tried to delete my app, disconnect FB account from app and again connect it but this issue still exist.</p>
<p>For now, the soultion is to delete FB app and when integrate with FB via my app. User needs to enter credentials in the modal (webview). Then in the webview, the buttons won't hide. But it's not a valid solution, why would user delete his/her FB app.</p>
<p>In the previous version of FB SDK, the buttons won't hide but the UI in the new version (that updates automatically) is disturbed.</p>
<p><a href="https://i.sstatic.net/V7q2zvth.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/V7q2zvth.png" alt="enter image description here" /></a></p>
<p><a href="https://i.sstatic.net/OwIc0U18.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/OwIc0U18.jpg" alt="enter image description here" /></a></p>
Continue reading...
 

Latest posts

Online statistics

Members online
0
Guests online
4
Total visitors
4
Top