AsteroidOSSync
AsteroidOSSync copied to clipboard
Notification actions
Hello,
On Android Wear, it is possible to swipe to various actions on a notification:
Whereas on AsteroidOS I can't execute an action from the notification:
Are there any plans to support this?
Hi Rudloff, No plans for this in v1.0. However I mark the issue for v1.1
🧪 I made a small experiment in the onNotificationPosted
function (NLService
).
This snipped of Kotlin code woulde automatically reject incoming calls from Telegram X or WhatsApp:
if (notification.category == Notification.CATEGORY_CALL && notification.actions.size == 2) {
try {
// Cancel right away
notification.actions.first().actionIntent.send()
} catch (e: PendingIntent.CanceledException) {
// TODO: Handle
}
}
As long as all the apps are setting up their actions as reject & accept (in that order), this code should work for all apps. By performing individual tests, one could build a list of apps that don't respect this order and invert the control for them.
I don't think we want to hardcode any "reject & accept" behaviours in the AsteroidOS protocols. I believe we should only forward a list of possible actions to the watch, in the order that they are shown in the Android app, and let the user click on any of those actions. Keeping a list of apps is very brittle as the app developers could just decide to swap the buttons some day. Also there is no point making this specific to two actions when we can make this generic to all actions more easily.
Totally agree! Good points. Still, the way the actions are triggered would apply, it's fairly simple.
De: Florent Revest [email protected] Enviado: viernes, 7 de agosto de 2020 0:21 Para: AsteroidOS/AsteroidOSSync [email protected] CC: Alejandro H. Cruz [email protected]; Comment [email protected] Asunto: Re: [AsteroidOS/AsteroidOSSync] Notification actions (#33)
I don't think we want to hardcode any "reject & accept" behaviours in the AsteroidOS protocols. I believe we should only forward a list of possible actions to the watch, in the order that they are shown in the Android app, and let the user click on any of those actions. Keeping a list of apps is very brittle as the app developers could just decide to swap the buttons some day. Also there is no point making this specific to two actions when we can make this generic to all actions more easily.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/AsteroidOS/AsteroidOSSync/issues/33#issuecomment-670220122, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAOQVOXXSZISA3OY3MZFPRTR7MUHNANCNFSM4EDLUPYA.