fix get fcm token
This commit is contained in:
parent
bf565f7118
commit
ebb96bdbb8
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user