fix get fcm token

This commit is contained in:
BDA MacMini 2025-08-06 11:27:52 +07:00
parent bf565f7118
commit ebb96bdbb8

View File

@ -42,25 +42,25 @@ class LoginScreen extends Component {
if (regex.test(this.state.username) === true) {
console.log('true')
// const fcm = messaging()
// if (!await fcm.hasPermission()) {
// try {
// await messaging().requestPermission()
// } catch (error) {
// this.setState({
// isLoading: false
// })
// }
// }
const fcm = messaging()
if (!await fcm.hasPermission()) {
try {
await messaging().requestPermission()
} catch (error) {
this.setState({
isLoading: false
})
}
}
// const fcmToken = await messaging().getAPNSToken()
const fcmToken = await messaging().getAPNSToken()
let params = {
// mobile: this.state.username,
username: this.state.username,
password: this.state.password,
// fcm_token: fcmToken
fcm_token: fcmToken
}
console.log('params >> ', params)