Open meghachetan opened 5 years ago
Hard to tell what's going on without more detail. I have similar code working fine. try adding
try {
await FCM.requestPermissions();
} catch (error) {
console.log(error);
// do something here
}
before you createNotificationChannel
. When you say "Not working No result" what do you mean? For example, createNotificationChannel
does not return anything. What happens if you step over/into the code in a debugger?
I am using this module for push notifications in my react-native app using firebase cloud messaging service. I follow up this module example simple-fcm-client but i had implemented code for it but it is not working.
Problem: when i starts my app i check out with console that i have the correct FCM object with me but found that the function FCM.createNotificationChannel not working. Means the code doesn't works out from the FCM.createNotificationChannel function even if any normal console line is written next to this function block and also no error comes from the step the function of notification channel is called.
Expected: Please help me for properly executing the push notifications implementation in my react-native app using fcm with fcm registered token for the android ios device.
RN(React Native) Version 0.55.2 react-native-fcm Version 16.2.0 Device using Android 7 device Android CompileSDKVersion = 26 Android TargetSDKVersion = 26 AndroidMinSDKVersion = 16 Java Version 8 Windows 7 App running either in foreground or background but the FCM Object functions usage neither works out nor gives any error.
===========build.gradle file================== buildToolsVersion = "26.0.3" minSdkVersion = 16 compileSdkVersion = 26 targetSdkVersion = 26 supportLibVersion = "26.0.0-alpha1"
=================React Native Code=============== import FCM, {FCMEvent, RemoteNotificationResult, WillPresentNotificationResult, NotificationType, NotificationActionType, NotificationActionOption, NotificationCategoryOption} from "react-native-fcm";
` async componentDidMount() {
}`