question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android : onNotification not working in local notification

See original GitHub issue

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>`

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:28 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
tomarviii88commented, Jan 18, 2021

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.

0reactions
HappyCodingLovercommented, Mar 17, 2021

@Dallas62 thanks for this awesome lib now, localNotification and ScheduleNotification only gives me vibration, and don’t appear. Can you tell me why?

Version: ^7.2.1 RN: 63.3 Google Services 4.3.5 Mobile: Huawei, Android 9.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native-push-notification - local notifications not working ...
Called when a remote is received or opened, or local notification is opened onNotification: function(notification) { console.
Read more >
react-native-push-notification - npm
React Native Local and Remote Notifications for iOS and Android ... Read the troubleshooting guide before raising an issue.
Read more >
How to use the react-native-push-notification.configure ... - Snyk
Use Snyk Code to scan source code in minutes - no build needed - and fix ... or local notification is opened or...
Read more >
Implementing React Native Push Notifications in Android Apps
There are two main ways you can send push notifications to your app users: local and remote. Local notifications are sent from a...
Read more >
React Native Local Push Notifications | by Saad Khan - Medium
Basically, the push notification does not trigger from a cloud service, for example, ... In this post, I will be showing the android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found