File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
android/app/src/main/res/raw Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" utf-8" ?>
2
+ <!-- This file is necessary for notifications to work in release builds.
3
+
4
+ The issue is that the package:flutter_local_notifications API has us
5
+ identify which icon we want to use via a string name, in Dart code,
6
+ and that's invisible to the resource shrinker:
7
+ https://developer.android.com/build/shrink-code#keep-resources
8
+ If the icon isn't named in this file, it gets removed in release builds
9
+ (more precisely, replaced with a 0-byte file, which is invalid for its
10
+ image format). The system then discards notifications that try to use
11
+ the invalid icon file:
12
+ https://github.com/zulip/zulip-flutter/issues/528
13
+ -->
14
+ <resources xmlns : tools =" http://schemas.android.com/tools"
15
+ tools : keep =" @drawable/zulip_notification"
16
+ />
Original file line number Diff line number Diff line change @@ -322,7 +322,8 @@ class NotificationDisplayManager {
322
322
'(Zulip internal error)' , // TODO never implicitly create channel: https://github.com/MaikuB/flutter_local_notifications/issues/2135
323
323
tag: conversationKey,
324
324
color: kZulipBrandColor,
325
- icon: 'zulip_notification' , // TODO vary for debug
325
+ // TODO vary notification icon for debug
326
+ icon: 'zulip_notification' , // This name must appear in keep.xml too: https://github.com/zulip/zulip-flutter/issues/528
326
327
// TODO(#128) inbox-style
327
328
328
329
// TODO plugin sets PendingIntent.FLAG_UPDATE_CURRENT; is that OK?
You can’t perform that action at this time.
0 commit comments