From ebb96bdbb82ee4c3782f638094d22c0f9cb44825 Mon Sep 17 00:00:00 2001 From: BDA MacMini <> Date: Wed, 6 Aug 2025 11:27:52 +0700 Subject: [PATCH] fix get fcm token --- src/screens/login/Login.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/screens/login/Login.js b/src/screens/login/Login.js index e9521e0..793a380 100644 --- a/src/screens/login/Login.js +++ b/src/screens/login/Login.js @@ -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)