react-native-push-notification: Android : onNotification not working in local notification

Hi, how can i acces onNotification in local notification? despite all the advice on the net nothing works

` <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_name" android:value="localpush"/> <meta-data android:name="com.dieam.reactnativepushnotification.notification_channel_description" android:value="localpush"/>

    <!-- Change the value to true to enable pop-up for in foreground (remote-only, for local use ignoreInForeground) -->
    <meta-data  android:name="com.dieam.reactnativepushnotification.notification_foreground" android:value="true"/>
    <!-- Change the value to false if you don't want the creation of the default channel -->
    <meta-data  android:name="com.dieam.reactnativepushnotification.channel_create_default"
                android:value="true"/>
    <!-- Change the resource name to your App's accent color - or any other color you want -->
    <meta-data  android:name="com.dieam.reactnativepushnotification.notification_color"
                android:resource="@color/white"/> <!-- or @android:color/{name} to use a standard color -->

    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" />
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
        </intent-filter>
    </receiver>

    
    <service
        android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
        android:exported="false" >
        <intent-filter>
         <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>`

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Comments: 28 (1 by maintainers)

Most upvoted comments

Check if you have created channel or not because without channel notifications won’t work now. Checkout this: https://github.com/zo0r/react-native-push-notification#channel-management-android And for more reference you can go through the /example directory of this repository.