You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use this plugin, it is valid before 2023/2/10, But after that, The FacebookLogin.login function cannot be used to log in correctly, The following is the result screen.
I tried on my cellphone and emulator,And get the same result, The following is smartphone information.
Device: [ZenFone 5Z (ZS620KL)]
OS: Android 10
Emulator
Device: [Nexus 5X API31]
OS: Android 12.0 x86_64
Here is my code.
<template>
<button @click="login()">
<img src="../assets/images/fb_button.jpg"/>
</button>
<p>{{ token }}</p>
<p>{{ expiration_time }}</p>
<p>{{ expiresInt }}</p>
<p>{{ userID }}</p>
<p>{{ status }}</p>
<input type="button" value="logout" @click="logout()"/>
<input type="button" value="getProfile" @click="getProfile()" />
<p>{{ email }}</p>
</template>
<script>
import {
FacebookLogin
} from '@capacitor-community/facebook-login';
I use this plugin, it is valid before 2023/2/10, But after that, The FacebookLogin.login function cannot be used to log in correctly, The following is the result screen.
I tried on my cellphone and emulator,And get the same result, The following is smartphone information.
Emulator
Here is my code.
<template>
<button @click="login()">
<img src="../assets/images/fb_button.jpg"/>
</button>
<p>{{ token }}</p>
<p>{{ expiration_time }}</p>
<p>{{ expiresInt }}</p>
<p>{{ userID }}</p>
<p>{{ status }}</p>
<input type="button" value="logout" @click="logout()"/>
<input type="button" value="getProfile" @click="getProfile()" />
<p>{{ email }}</p>
</template>
<script>
import {
FacebookLogin
} from '@capacitor-community/facebook-login';
const FACEBOOK_PERMISSIONS = [
'email',
'user_birthday',
'user_photos',
'user_gender'
];
export default {
name: 'HelloWorld',
props: {
msg: String
},
data(){
return {
token: "token",
expiration_time: "expiration_time",
expiresInt: "expiresInt",
userID: "userID",
status: "status",
email: "email"
};
},
methods:{
async login(){
let that = this;
const result = await FacebookLogin.login({ permissions: FACEBOOK_PERMISSIONS })
if (result.accessToken) {
// Login successful.
that.token = result.accessToken.token;
that.expiration_time = result.accessToken.expires;
that.expiresInt = result.expiresIn;
that.userID = result.accessToken.userId;
that.status = "connected";
}
},
async logout(){
await FacebookLogin.logout();
},
async getProfile(){
let that = this;
let email ="";
let profile = await FacebookLogin.getProfile<{
email
}>({ fields: ['email'] });
that.email = profile.email;
}
}
}
</script>
Thanks to everyone who paid attention.
The text was updated successfully, but these errors were encountered: