termux-notification - Mi Band 4 - App not listed in Android app notification settings
Problem description
Termux:API notifications are in separate 'Termux API notification channel' from the App Termux:API. The app is not listed in the Android app notification settings. Only Termux is being listed, Termux:API is not but notifications appear from Termux:API. Trying to find Termux:API notification settings, they can only be found via Settings > Apps > Termux:API > Notifications > ...
Without Termux:API as a separate app in notification settings, I'm not able to add Termux:API notifications to my Mi Band 4.
Steps to reproduce
- Starting a notification:
termux-notification -c "content" -t "title"
-
A notification appears where the app name is Termux:API, title and content as given per command call.
-
Only a long press on the notification gives the ability to disable notifications?
Expected behavior Seeing the notification appear from the app Termux. Or making Termux:API visible to the Android app notification settings list.
Additional information
Output of command termux-info:
Updatable packages:
termux-tools/stable 0.73 all [upgradable from: 0.72]
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://termux.org/packages stable/main
System information:
Linux localhost 4.14.117-perf-g8035d1a #1 SMP PREEMPT Fri Nov 1 20:45:33 CST 2019 aarch64 Android
Termux-packages arch:
aarch64
Android version:
10
Device manufacturer:
Xiaomi
Device model:
MI 9
Notification from termux-notification listed in termux-notification-list:
[
{
"id": 0,
"tag": "7a45dc41-aa67-48b1-8a59-11ce3eb02855",
"key": "0|com.termux.api|0|7a45dc41-aa67-48b1-8a59-11ce3eb02855|10174",
"group": "",
"packageName": "com.termux.api",
"title": "title",
"content": "content"
},
]
Additional info, may be totally unnecessary for the issue above...
Notification (Outlook new email) that also appears on my Mi Band 4, output from termux-notification-list:
[
{
"id": 1,
"tag": "notifGroup:32768",
"key": "0|com.microsoft.office.outlook|1|notifGroup:32768|10176",
"group": "notifGroup:32768",
"packageName": "com.microsoft.office.outlook",
"title": "<sender name>",
"content": "Test Content"
},
{
"id": 2,
"tag": "32768:[0, 9, 0, 46, ..., -6, -80, 0, 0]",
"key": "0|com.microsoft.office.outlook|2|32768:[0, 9, 0, 46, ..., -6, -80, 0, 0]|10176",
"group": "notifGroup:32768",
"packageName": "com.microsoft.office.outlook",
"title": "<sender name>",
"content": "Test • Content"
},
]
Note: id: 2 is being displayed on my Mi Band and in the Android status bar. The number array is being truncated but the same in tag and key and may be the email address that appears after the app name but the numbers are weird. Not sure how to translate them, seems to range between -128 and 127. Gmail seems to encode them differently.
Notification from Gmail:
[
{
"id": 0,
"tag": "gig:-2:^sq_ig_i_personal",
"key": "0|com.google.android.gm|0|gig:-2:^sq_ig_i_personal|10092",
"group": "gig:-2:^sq_ig_i_personal",
"packageName": "com.google.android.gm",
"title": "<user name>",
"content": "Test"
},
{
"id": -8...,
"tag": "gig:-2:^sq_ig_i_personal",
"key": "0|com.google.android.gm|-8...|gig:-2:^sq_ig_i_personal|10092",
"group": "gig:-2:^sq_ig_i_personal",
"packageName": "com.google.android.gm",
"title": "<user name>",
"content": "Test"
},
]
gig:-2 and -8 are also being truncated.
I only listed Outlook and Gmail because they seem to generate two notifications for a single visible notification. When Gmail lists several grouped notifications then the format changes again ...
me too!Do you find the way to solve it?
Same issue on Galaxy Watch 4, with the Galaxy Wear app. The easiest way to resolve this is to give TermuxAPI an optional launcher icon/main activity.
Guys there's a solution:Use notify for miband then everything works perfect
That looks cool but not all of us use Mibands.
Same issue on Galaxy Watch 4, with the Galaxy Wear app. The easiest way to resolve this is to give TermuxAPI an optional launcher icon/main activity.
That do you mean? Can you explain in more detail?
Same with Huawei watch gt3 pro. I use node-red to show notifications but I can't find Termux:API app within Huawei health to allow notifications from it. I think it can be solved by adding start activity with some intro text like you can see in Termux:boot extension.
I temporrary solved it with MacroDroid app. I created macros to watch notifications from Tetmux:Api then create new one from MacroDroid
Test.macro
{"exportedActionBlocks":[],"isActionBlock":false,"isBeingImported":false,"isClonedInstance":false,"isFavourite":false,"localVariables":[],"m_GUID":-7131716804972791873,"m_actionList":[{"blockNextAction":false,"m_iconBgColor":-769226,"m_imageResourceId":0,"m_macroGUIDToRun":0,"m_notificationChannelType":0,"m_notificationSubject":"{not_ticker}","m_notificationText":"{notification}","m_overwriteExisting":false,"m_priority":0,"m_ringtoneIndex":0,"m_ringtoneName":"По умолчанию","m_runMacroWhenPressed":false,"notificationActionButtons":[],"notificationChannelName":"Уведомление","preventBackButtonClosing":false,"m_SIGUID":-6451735844851550035,"m_classType":"NotificationAction","m_constraintList":[],"m_isDisabled":false,"m_isOrCondition":false}],"m_category":"Без категории","m_constraintList":[],"m_description":"","m_descriptionOpen":false,"m_enabled":true,"m_excludeLog":false,"m_headingColor":0,"m_isOrCondition":false,"m_name":"Notifications test","m_triggerList":[{"enableRegex":false,"m_applicationNameList":["Termux:API"],"m_exactMatch":false,"m_excludeApps":false,"m_excludes":false,"m_ignoreOngoing":true,"m_option":0,"m_packageNameList":["com.termux.api"],"m_soundOption":0,"m_supressMultiples":true,"m_textContent":"","m_SIGUID":-6754808784810114100,"m_classType":"NotificationTrigger","m_constraintList":[],"m_isDisabled":false,"m_isOrCondition":false}]}