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.

SDK 41 Android notifications don't work in Snack

See original GitHub issue

Summary

Snack example from https://docs.expo.io/versions/latest/sdk/notifications/#api don’t work with notifications from expo API (sendPushNotification function in example or Push notifications tool) but works with scheduleNotificationAsync.

Device: Redmi Note 8 Pro

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

41

Environment

Expo snack

Reproducible demo or steps to reproduce from a blank project

https://snack.expo.io/@andreybaryshev/push-notifications

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AndreyBaryshevcommented, May 11, 2021

My problem was in that I made upgrade SDK from 37 to 41 and my project didn’t include it:

Notifications.setNotificationHandler({
  handleNotification: async () => ({
    shouldShowAlert: true,
    shouldPlaySound: true,
    shouldSetBadge: true
  })
});

Without setNotificationHandler and with SDK41 notifications don’t show when app in foreground, but with SDK40 it works. I added setNotificationHandler and now it works for me. Thank you very much @cruzach!

P.S. It still doesn’t work in Snack for me. Regardless app is in foreground or background.

0reactions
github-actions[bot]commented, Feb 3, 2022

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications - Expo Documentation
Check out the Snack below to see Notifications in action, but be sure to use a physical device! Push notifications don't work on...
Read more >
iOS - Expo Notifications.getExpoPushTokenAsync() not ...
I will need it to work on android as well, but I figured making it work for one platform first and then move...
Read more >
Expo SDK 39 is now available - DEV Community ‍ ‍
We're still working on support for react-native-reanimated v2 alpha in Snack; this may be available in the coming weeks after this release.
Read more >
Display a snackbar - Flutter documentation
Display a snackbar · 1. Create a Scaffold. When creating apps that follow the Material Design guidelines, give your apps a consistent visual...
Read more >
Notifications Not Shown - Mobile Push
Android App is Force Stopped ; MIUI 10, Settings > Battery & performance > Choose apps > Select the app that is not...
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