fix ios push notification registration

This commit is contained in:
kanyanat 2025-12-01 14:40:13 +07:00
parent 86eec87b8c
commit 601bd7fb56
2 changed files with 166 additions and 162 deletions

3
App.js
View File

@ -135,6 +135,9 @@ class App extends Component {
if (!device) { if (!device) {
this.initNotification() this.initNotification()
} else {
this.setPermission()
this.setupNotificationListeners()
} }
console.log('app state', appState, device) console.log('app state', appState, device)

View File

@ -63,6 +63,7 @@ class LoginScreen extends Component {
if (enabled) { if (enabled) {
console.log('Notification permission granted.'); console.log('Notification permission granted.');
await messaging().registerDeviceForRemoteMessages();
fcmToken = await messaging().getToken(); fcmToken = await messaging().getToken();
console.log('fcmToken >>>> ', fcmToken) console.log('fcmToken >>>> ', fcmToken)
} else { } else {