Comments (9)
Current code from the readme
var FBSDKLogin = require('react-native-fbsdklogin');
var {
FBSDKLoginManager,
} = FBSDKLogin;
// ...
// Attempt a login using the native login dialog asking for default permissions.
FBSDKLoginManager.setLoginBehavior(GlobalStore.getItem('behavior', 'native'));
FBSDKLoginManager.logInWithReadPermissions([], (error, result) => {
if (error) {
alert('Error logging in.');
} else {
if (result.isCanceled) {
alert('Login cancelled.');
} else {
alert('Logged in.');
}
}
});
// ...
from react-native-fbsdk.
The underlying Facebook SDK for iOS chooses the best login method available. By specifying login behavior native you are simply telling the sdk that it can login through the native app.
for more details on why this the behavior
http://stackoverflow.com/questions/32375916/safari-web-view-opening-when-logging-to-fb-through-ios-9
from react-native-fbsdk.
Ah, thanks for the info.. This is a shame as the login dialog now gets hidden underneath other modals easily.
from react-native-fbsdk.
MossP it should open in safari and switch to that app and not a web view. Are you seeing it open a web view.
You might want to try just leaving the behavior as the default and it should on ios 9+ open the safari view controller which will fast app switch to safari and on older devices use the facebook app if installed else open a webview.
from react-native-fbsdk.
Yeah, It's opening in a modal for me, even with 'default' behaviour and doesn't fast switch anywhere. It just gets lost, buried in the app. I only get to see it when I close windows in the app and then I see several opened modals all grouped together.
I'll look again to see if it's the security enhancements of iOS9 that are causing it if that's what it's supposed to do. Thanks again, @swiese.
from react-native-fbsdk.
I checked the security settings. All are ok. The modal just insists on opening and sitting out of view until I close everything. Looks like there are quite a few devs put out by this change. It's a real shame. I might have to look at an alternative approach to logging users in. Thanks again.
from react-native-fbsdk.
Did you ever figure this out? I'm calling LoginManager.logInWithReadPermissions(), but my login dialog is hidden, though it blocks my await/promise to return, so it's open underneath there somewhere...
But using a FBLoginButton, it appears to pop up a login modal just fine. My best guess is that this might be because the manual logInWithReadPermissions implementation passes an fromViewController:nil, whereas the FBLoginButton calls fromViewController:[FBSDKInternalUtility viewControllerforView:self]?
Unfortunately, sometimes I need to re-request permissions automatically (ie a completely expired access token, or needing to upgrade them to the latest set of permissions I use), and I'd rather not present them with a login button. (At least, I never did it in my iOS app using FB SDK...)
from react-native-fbsdk.
Unfortunately not. I stayed with an old version (of RN and FBSDK) for that particular project and changed my flow in future apps to avoid the situation.
from react-native-fbsdk.
Okay, so my guess was wrong, as it seems to be timing-related. But I see this issue is closed, so I've opened a new one to track my issue.
from react-native-fbsdk.
Related Issues (20)
- Cannot complete login on iOS 13 HOT 5
- CONTRIBUTING.md file: CLA broken link
- Submit permission for Live mode
- Remove deprecated unarchiveObjectWithData methods HOT 1
- SERVER_ERROR: [code] 1349195 [message]: The key hash does not match any stored key hashes. in Real Device (Android) HOT 5
- ShareDialog sharing doesn't work on some Android phones (Huawei p30 pro, Xiaomi redmi 9) HOT 1
- Not able to login with facebook app only in iOS HOT 3
- Expo-facebook does not send Android installation events to the platform, only IOS
- Any plan on upgrading to FB SDK v9 for iOS? HOT 38
- Android cannot compile under 3.0.0 (cannot find symbol FacebookSdk.setDataProcessingOptions) HOT 1
- Sdk update to v9.0 HOT 2
- Subscribe event not fired on Android
- Is there a way to get the download source?
- setAdvertiserTrackingEnabled not found HOT 4
- autoInitEnabled is removed from iOS, should wrap the initialize function
- Some input files use or override a deprecated API
- Missing important data in FB Analytics HOT 1
- Regarding deep link handling
- Yarn no good for the scripts
- Issues with app privacy on the App Store HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-fbsdk.