New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android 12 not receving expo-notifications correctly #16678
Comments
|
I got this error On SDK 44 (expo-managed)- Test on (MIUI 12) Expected behavior: Make sound after 5 seconds. |
|
I had this issue, the error message is not very helpful but you'll probably will find more information with Logcat or something like that. For me, the actual error came up using Android Studio's logcat:
Turns out that my I hope this helps. |
|
@txvnt We're experiencing the same issue. Can confirm that after setting both |
We are on Expo SDK 43, bare workflow. After reverting to |
|
i`m on expo sdk 45 compileSdkVersion 31 and targetSdkVersion 31, started receiving the bad error "Failed to schedule notification" |
|
I have the same issue, notifications are not received on my android 12 Xiaomi 11 lite, MIUI Global 13.0.8 |
|
I'm facing the same issue: receiving the error "Failed to schedule notification" with compileSdkVersion 31 and targetSdkVersion 31. Any solutions? |
Yes, I tried it and it works with compileSdkVersion and targetSdkVersion 30. |
Setting 30 version seems to be the temporary solution so far |
|
Since the error I was getting was I will try this evening though, maybe I'm lucky. |
|
Same issue. |
|
if you are using android sdk 30, you should use expo sdk 44. if you are using android sdk 31, you should use expo sdk 45. https://blog.expo.dev/expo-sdk-45-f4e332954a68 |
|
If you're using Expo SDK 43 (and cannot upgrade yet), we were able to resolve this by patching expo-notifications with changes from these PRs: #17334 and #17333. These can be applied as a post-install patch using patch-package. Here's the patch: https://gist.github.com/ourmaninamsterdam/bf02b263c9a7aabca838ce21a1f9f6df |
Summary
Upon sending notifications to an app using android SDK 31 the notifications never appear on the mobile phone.
The
Notifications.addNotificationReceivedListeneris still called, but notification is never shown in the UI.Also the
Notifications.scheduleNotificationAsyncresults inError: Failed to schedule notification.This is to my knowledge only happening on android 12.
Downgrading to SDK 30 makes notification work as expected again.
Tested with Poco F3, MIUI Global 13.0.3
Managed or bare workflow? If you have
ios/orandroid/directories in your project, the answer is bare!bare
What platform(s) does this occur on?
Android
SDK Version (managed workflow only)
44.0.6
Environment
expo-env-info 1.0.2 environment info:
System:
OS: Linux 5.15 Manjaro Linux
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 14.17.0 - ~/.nvm/versions/node/v14.17.0/bin/node
Yarn: 1.22.17 - /usr/bin/yarn
npm: 6.14.13 - ~/.nvm/versions/node/v14.17.0/bin/npm
SDKs:
Android SDK:
API Levels: 29, 30, 31
Build Tools: 28.0.3, 29.0.2, 30.0.3
System Images: android-30 | Google APIs Intel x86 Atom
npmPackages:
expo: ~44.0.0 => 44.0.6
react: 17.0.1 => 17.0.1
react-dom: 17.0.1 => 17.0.1
react-native: 0.64.3 => 0.64.3
react-native-web: 0.17.1 => 0.17.1
Expo Workflow: bare
Reproducible demo
Setting up a new bare workflow with
expo init test-notificationsexpo ejectInstalling / Setting up expo notifications
expo install expo-notificationsAnd following: https://docs.expo.dev/guides/setup-native-firebase/#bare-workflow-setup
Inserting the example from https://docs.expo.dev/versions/latest/sdk/notifications/ in
App.jsUpgrading android SDK in root build.gradle
And adding
android:exported="true"to AndroidManifest.xml under.MainActivity, activity tag.Now the issue can be reproduced by either pressing the schedule notification button or sending a notification to the push token, for example through the expo push notification tool.
The text was updated successfully, but these errors were encountered: