[android][notifications] disabling OTA updates breaks notifications on standalone APK
See original GitHub issueš Bug Report
Summary of Issue
Remote notifications stop working on android santdalone apk built with "updates": { "enabled": false }
app.json config.
Environment
Expo CLI 3.27.13 environment info:
System:
OS: macOS 10.15.6
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.11.0 - ~/.nodenv/versions/14/bin/node
Yarn: 1.22.5 - /usr/local/bin/yarn
npm: 6.14.8 - ~/.nodenv/versions/14/bin/npm
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6626763
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
expo: ~39.0.2 => 39.0.3
react: 16.13.1 => 16.13.1
react-dom: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-39.0.3.tar.gz => 0.63.2
react-native-web: ~0.13.12 => 0.13.14
npmGlobalPackages:
expo-cli: 3.27.13
Expo Workflow: managed
Tested on Android 9 and 10
Reproducible Demo
To reproduce you can use this repo: https://github.com/DiegoAndai/notif-debug-1
Quick way:
There are two APKs on the repo, these have a āsend remote notificationā button so you can easily test if the notifications are being displayed. The only difference between the two is the "updates"
app.json field. The one built with "updates": { "fallbackToCacheTimeout": 0 }
(lets call it apk A) displays notifications as expected, but the one built with "updates": { "enabled": false }
(apk B) doesnāt show anything.
Slower way:
You can build your own apks with the code on the repo. I made two commits, one with each configuration described above. Youāll have to provide the FCM configuration.
The apks also show a local notification button, the Exponent Push Token and the "updates"
field content of the manifest.
Steps to Reproduce
Whether you built your own or use the provided apks, install and use the āsend remote notificationā button, one will show notifications and the other wonāt. The app also displays the Exponent Push Token if you want to use the notification tool, which doesnāt show any error messages for the apk B, even though notifications donāt show up.
Expected Behavior vs Actual Behavior
Remote notifications should work with either configuration.
Notes
Both configurations work fine on Expo Client, probably as "updates": { "enabled": ... }
is ignored
I donāt think the updates configuration has much to do with notifications, so maybe there is a deeper problem and there are more symptoms that Iām not seeing. I really donāt know much about how to debug this further or search for an explanation in Expoās source code.
When using the "updates": { "fallbackToCacheTimeout": 0 }
(apk A), updates are not disabled, and as I published the "updates": { "enabled": false }
(apk B) version after, the apk A displays updates manifest field: { "enabled": false }
after a while (as it downloads the update), but the notifications still work. Thatās why I describe the bug as āRemote notifications stop working on android santdalone apk built with "updates": { "enabled": false }
ā.
I hope that helps. Thanks in advance!
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
fix is deployed to production! Going to close this now but please let us know if the issue persists.
Hey @DiegoAndai ā no need to wait for the next SDK release, we just need to deploy the fix to our build servers and then once itās deployed youāll need to rerun
expo build:android
. Weāre working on this now and Iāll update/close this issue when itās done.