I'm trying to add Facebook SDK for my Android expo app to track the app installs. I've added the code below into StartupScreen.js in useEffect:
const fbEvent = await Facebook.initializeAsync({
appId: "FB_APP_ID",
appName: "FB_APP_NAME",
})
console.log('fbEvent::', fbEvent)
However, the log is showing undefined and there is no app events showing in Facebook.
How can I solve this? Thanks in advance.
Related
I'm using Expo SDK v. 45, iPhone 13 Pro (iOS v. 15.5), expo-sharing v. 10.1.1.
I'm currently using expo start --dev-client to test my app on my iPhone. I need to be able to share a file, created inside the app, with the outside world. I found expo-sharing to achieve this. Unfortunately, when I run
install * as Sharing from 'expo-sharing';
...
useEffect( async () => {
const canShare = await Sharing.isAvailableAsync();
if (canShare) {
console.log("available");
} else {
console.log("Not available");
}
}, []);
I get 'Not available'.
What must I do to get my app to allow sharing? I can't find anything in the Expo documentation.
Thank you.
In case anybody else has a similar issue: all I had to do was rebuild the app and reinstall it on my phone. Now it works.
I want to use Jitsi-meet in react native for video conferencing what is the best method for implementation.
Currently I am following this link https://jitsi.github.io/handbook/docs/intro
But in this they have used native code for android and iOS
Can someone please suggest me how should I proceed further.
The link you provided is the documentation of the jitsi native SDK. If you want to implement this SDK in a react-native project, you should have a look at react-native-jitsi-meet plugin.
As you can read in the documentation of the plugin, just install the plugin, and you will be able to initiate calls with your room url :
componentDidMount() {
setTimeout(() => {
const url = 'https://your.jitsi.server/roomName'; // can also be only room name and will connect to jitsi meet servers
const userInfo = { displayName: 'User', email: 'user#example.com', avatar: 'https:/gravatar.com/avatar/abc123' };
JitsiMeet.call(url, userInfo);
/* You can also use JitsiMeet.audioCall(url) for audio only call */
/* You can programmatically end the call with JitsiMeet.endCall() */
}, 1000);
}
I am using React native Google Sign in plugin for authenticating the users, to use google photos API. According to the given documentation of the plugin, I did the configurations. It is working fine on the iOS platform but not on the Android platform.
configuring google sign in
configureGoogleSignIn = async () => {
GoogleSignin.configure({
scopes: [
'https://www.googleapis.com/auth/photoslibrary',
'https://www.googleapis.com/auth/photoslibrary.sharing',
],
shouldFetchBasicProfile: true,
iosClientId:
Platform.OS === 'ios'
? 'iOS_PLATFORM_CLIENT_ID'
: 'ANDROID_PLATFORM_CLIENT_ID',
// offlineAccess: true,
});
};
When I use this code and sign in with an iOS device or simulator it is working fine and return the user details with idToken but on the android device, it only returns the user details and idToken as null.
Anybody help me with this
I'm trying to implement Face ID in my React Native project.
...
import * as LocalAuthentication from 'expo-local-authentication';
...
componentDidMount = async () => {
const hasAuth = await LocalAuthentication.hasHardwareAsync();
if(hasAuth)
LocalAuthentication.authenticateAsync();
}
...
When I run it in expo expo-start using my phone, it opens the iPhone page where ask for passcode (not faceID). After entering the passcode it returns the warning message below and the Face ID does not work.
FaceID is not available in Expo Client. You can use it in a standalone Expo app by providing `NSFaceIDUsageDescription`
I also added the NSFaceIDUsageDescription to my app.json.
"infoPlist": {
"NSFaceIDUsageDescription": "This app will optionally use Face ID or Touch ID to save login"
}
Expo Local Authentication FaceID doesnt work on expo client app, but you can test it building an archive IPA for IOS. expo build:ios -t archive. It will create a build for IOS and then you can test it.
I'm using React Native 0.61.5 with react-native-fbsdk 2.0.0. Facebook app is Live and configured.
The problem is with the Facebook Login when the permission is removed, facebook cannot re-authorise the Facebook Login anymore and keep displaying error in the facebook app.
error message with Facebook App already signed-in and try to use facebook login
Above was just one of the test case. Prior to "Removing" the app permission in Facebook, the facebook login seems to be fine.
This is the basic RN code for Facebook Login
<LoginButton
onLoginFinished={
(error, result) => {
if (error) {
console.log("login has error: " + result.error);
} else if (result.isCancelled) {
console.log("login is cancelled.");
} else {
AccessToken.getCurrentAccessToken().then(
(data) => {
console.log(data.accessToken.toString())
}
)
}
}
}
onLogoutFinished={() => console.log("logout.")}/>
Any of you have any clue or solution?
I'm expecting that the facebook login will re-authorize again but it's not.
Please try adding permissions to the LoginButton like this. So that login button will look for the permissions too. Let me know if facebook re autorize for you..
<LoginButton
permissions={["email", "user_friends", "public_profile"]}
onLoginFinished={this._onFacebookLoginFinished.bind(this)}
onLogoutFinished={this._onFacebookLogoutFinished.bind(this)}
/>
Thank you #imjaad for your attempt to answer my question.
I've resolved this by appealing on Facebook App which the app was Lived, but it has a message that "some of the functions are being restricted".
So, even if Facebook App is Live, make sure there is nothing else / warning / error message that shows up.
I tried to create another Facebook App and it was working fine as well. So nothing wrong with the fbsdk, rn or the code itself.
It was just rare event in Facebook while the appeal is in progress, the Facebook QC made it live temporary, but the message that the app is still being restricted still appear.
So make sure your FB App is Live and there is no other error / warning message in your Facebook App Dashboard.
Good Luck!