-
Notifications
You must be signed in to change notification settings - Fork 241
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
🐞Not working on Android Release when obfuscated to show Local Notifications #374
Comments
Any updates on this? I have the same issue for Android 12 only, but removing --obfuscate does not solve it. Everything runs perfectly on Android 10. |
I have the same issue, have you figured out a solution or a walkaround? |
I think @ened maintains this plugin, he might have some workarounds, I haven't found any yet. |
Finally found a solution with the help of dart-lang team.
@pragma('vm:entry-point')
void bgCallback() {
// You need below line until PR 388 is merged
DartPluginRegistrant.ensureInitialized();
//...
}
|
…Manager not working when App is obfuscated or using Flutter 3.1+
…ing when App is obfuscated or using Flutter 3.1+ (#405)
Notif showing, but audio not android/app/src/main/res/raw/file.mp3 |
Describe the bug
I am trying to show local notifications from workmanager. It works fine when I run on my physical Android device locally, but when I build an appbundle obfuscating the code, it won't work nor throw errors. I've tried with Flutter Local Notifications and with Awesome Notifications.
If I request to show notification from main thread, it works even when obfuscated the code. It won't work only if I call a Workmanager task and use the show method inside callbackdispatcher();
To Reproduce
I've created a fresh application with implementation of packages Workmanager and Flutter Local Notifications.
flutter build appbundle --obfuscate --split-debug-info={$FOLDER}
to create a bundle (replace $FOLDER with existing location)Expected behavior
Local notification should be shown on app initialization
Sample code to reproduce the problem
Sample Code
flutter doctor -v
[✓] Flutter (Channel stable, 2.10.4, on Linux Mint 20.3 5.4.0-107-generic,
locale en_US.UTF-8)
• Flutter version 2.10.4 at /home/bruno/_development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (11 days ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/bruno/Android/Sdk
• Platform android-31, build-tools 30.0.3
• Java binary at: /snap/android-studio/current/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio
• Android Studio at /snap/android-studio/current/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = /snap/android-studio/current/android-studio
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.66.0)
• VS Code at /usr/share/code
• Flutter extension version 3.38.0
[✓] Connected device (2 available)
• Linux (desktop) • linux • linux-x64 • Linux Mint 20.3
5.4.0-107-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.60
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
The text was updated successfully, but these errors were encountered: