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 - My local scheduled notifications pop up while my app is open

See original GitHub issue

Hi, I’d like to prevent my own notifications from popping up while my app is open.

Is there some kind of setting in RN-PN to enable/disable this behavior?

In OneSignal there is a setting called: inFocusDisplaying is there any equivalent in RN-PN?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:5

github_iconTop GitHub Comments

1reaction
lucask42commented, Jan 31, 2019

If the maintainers are interested in adding this feature I wouldn’t mind creating a PR for it

1reaction
gavin-gmlabcommented, Sep 19, 2017

I have this in my code: `

   onNotification: (notification) => {
    if (__DEV__) console.log('NOTIFICATION:', notification)
    if (!notification.foreground) {
      NavigationActions.mainScreen({type: 'reset'})
    } else {
      if (__DEV__) console.log('local Notification')
      Vibration.vibrate()
    }
  },

`

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications appear ONLY after opening the app! · Issue #1574
All notifications within the app are scheduled locally. ... Hi, I have the same Issue, after updating my phone to android 10, it's...
Read more >
Notifications Overview | Android Developers
A notification is required when your app is running a "foreground service"—a Service running in the background that's long living and noticeable to...
Read more >
Send a notification when the app is closed - Stack Overflow
I tried to work with these code examples but: Pushing notifications when app is closed - too many Activities/doesn't work.
Read more >
How to Not Let App Notifications Ruin Your Life | Clockwise
On your Android device, open the Settings app. Go to Sound & vibration > Do Not Disturb > Turn on automatically. Tap Add...
Read more >
Scheduling a Notification Locally from Your App
If the delivery of the notification occurs when your app isn't running or in the background, the system interacts with the user for...
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