[expo-facebook] requestPermissionsAsync model doesn't close
See original GitHub issueSummary
I was trying to make the facebook authentication on a manage workflow. So i implemented the method as the documentation said. It works perfectly on Expo go.
In standalone app, if safari has not logged in to facebook. The sdk will prompt the screen asking you if you want to make login with facebook app. Once i logged in with facebook app, facebook app redirects back the modal that was previously open never get closed so the authentication never completes.
Managed or bare workflow? If you have ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
41
Environment
Expo CLI 4.9.1 environment info:
System:
OS: macOS 11.4
Shell: 5.8 - /bin/zsh
Binaries:
Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v12.16.3/bin/yarn
npm: 6.14.7 - ~/.nvm/versions/node/v12.16.3/bin/npm
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
npmPackages:
expo: ~41.0.1 => 41.0.1
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.18
npmGlobalPackages:
expo-cli: 4.9.1
Expo Workflow: managed
Reproducible demo or steps to reproduce from a blank project
import React from 'react';
import { StyleSheet, Text, View, TouchableWithoutFeedback, Alert } from 'react-native';
import * as Facebook from 'expo-facebook';
export default function App({props}) {
const fbLogin = async () => {
try {
console.log('abc111123')
await Facebook.initializeAsync({
appId: 'xxxxxxx',
});
const {
type,
token,
expirationDate,
permissions,
declinedPermissions,
} = await Facebook.logInWithReadPermissionsAsync({
permissions: ['public_profile', 'email']
});
if (type === 'success') {
// Get the user's name using Facebook's Graph API
Alert.alert('Logged in!', `Hi ${token}!`);
} else {
// type === 'cancel'
}
} catch ({ message }) {
Alert.alert(`Facebook Login Error: ${message}`);
}
}
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<TouchableWithoutFeedback onPress={() => {
fbLogin()
}}><Text>Login</Text></TouchableWithoutFeedback>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:50 (18 by maintainers)
Top Results From Across the Web
expo-facebook not picking up facebook app id from app.json
For some reason, when upgrading from SDK40 to SDK42, our FB integration stopped working. I traced it to FB not seeing the app...
Read more >Unhandled promise rejection expo-tracking-transparency
I'm trying to implement ExpoTracking transparency on my react native ... is not an object (evaluating '_ExpoTrackingTransparency.default.
Read more >Facebook
If you do not do this, Facebook will not be able to redirect to your app after logging ... This uses both requestPermissionsAsync...
Read more >@expo/config-plugins | Yarn - Package Manager
This is the log of notable changes to the Expo client that are developer-facing. Package-specific changes not released in any SDK will be...
Read more >expo-error-recovery - NPM Package Versions
Utilities for helping you gracefully handle crashes due to fatal JavaScript errors. Version: 4.0.1 was published by brentvatne.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is my solution for EAS. Hope this helps someone.
anyone fixed this issue?