No connection status notification on Android 13
Describe the bug Connection notification does not appear even when all app notifications are allowed
To Reproduce How can the broken behavior be reproduced? Use Outline client and connect to server. Check notification center.
Expected behavior What behavior did you expect? Connection notification appears in the notification center
Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot of expected notification (from Android 10 device):
Client System (please complete the following information):
- Outline Client Version: Android 1.10.0 (same bug on 1.11.0)
- Your Operating System: Android 13, One UI 5.1 Galaxy S23 (same bug on Android 13, MIUI 14 POCO X3 Pro)
Submit Feedback Please submit feedback through the app and label it with this issue number.
Additional context Add any other context about the problem here.
Are there any updates on this?
Some info based on testing for https://github.com/Jigsaw-Code/outline-apps/pull/2657:
Currently the persistent notifications only work in API level 29 and 30. In API level 31+ they fail, which can be fixed by changing the following line:
PendingIntent.getActivity(this, 0, launchIntent, PendingIntent.FLAG_UPDATE_CURRENT);
With:
PendingIntent.getActivity(this, 0, launchIntent, PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
With this change they still won’t work in API level 33+, AFAIK because we don’t request POST_NOTIFICATIONS (not tested yet).
The API 31-32 fix is simple, can submit a PR soon.
But do we want to bother asking the user for notification permission just to display a persistent notification in API 33+ when newer Android versions already display a status bar icon and quick settings bubble for active VPN connections?