react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
745 stars 285 forks source link

Remote notification not working (ios) onRegister return deviceToken instead of fcmToken #352

Open HirenTariwala opened 2 years ago

HirenTariwala commented 2 years ago

I've followed the read.md file according to set all settings in Xcode and objective c files but still I am facing an issue receiving remote notification

I am using functional component register event for notification but still facing an issue onRemoteNotification function not calling.

localSchedule notification working fine token also registered

aravi365 commented 2 years ago

@HirenTariwala did you managed to fix it?

HirenTariwala commented 2 years ago

@aravi365 i've added react native firebase lib which work fine

aravi365 commented 2 years ago

could you please share some code? i tried, but getting errors regarding the firebase/app which needs to be initialised and so and so. Tried with firebase/messaging module, but it doesnt work without the main module i beleive. @HirenTariwala

HirenTariwala commented 2 years ago

@aravi365 it is inside import messaging from '@react-native-firebase/messaging';

useEffect(() => { messaging() .getToken() .then(fcmToken => { AsyncStorage.setItem(FCM_TOKEN, fcmToken) }) .catch(e => console.log(e)); }, [])

aravi365 commented 2 years ago

@HirenTariwala Have you used '@react-native-firebase/app anywhere? I got initialisation errors when i used this code directly

HirenTariwala commented 2 years ago

@aravi365 I have not used any where in app

HirenTariwala commented 2 years ago

@aravi365 I've installed that package