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][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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
esamelsoncommented, Oct 7, 2020

fix is deployed to production! Going to close this now but please let us know if the issue persists.

1reaction
esamelsoncommented, Oct 7, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How-to-prevent-disable-OTA-Android-12-updates-notifications ...
I'm currently running Android 11 with the latest security update and based on how broken the Android 12 update is, I do not...
Read more >
How to silence the updater and avoid auto-upgrade to Android ...
I disabled automatic updates but the notification annoys. ... Maybe it's possible to freeze updater without broke the existing system.
Read more >
Notifications interrupt music playback [36910897] - Issue Tracker
Testing on my newly-updated HTC Desire, Froyo, I've found that system notifications now don't pause or override other sounds. The only exception I...
Read more >
Do OTA updates in Expo work if the app has been published ...
Short answer: Yes. It's a valid question, because both have the word "bundle", but bundled assets are independent from Android App Bundle.
Read more >
OTA Firmware Updates | Getting Started - Particle docs
Managing over-the-air (OTA) firmware updates for Particle IoT devices. ... Encrypted communications: All messages between Particle devices and the DeviceĀ ...
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