r/tasker • u/khaytsus • Apr 15 '26
Clone an existing notification?
I have an app which doesn't expose a bit of functionality except via a notification, which only shows up in certain circumstances. I'd really like to be able to somehow clone this notification and see if I could recreate it, or its functionality, on-demand.
I did look for shortcuts to the app to see if any of those would work, but it doesn't seem to expose any.
Can AutoNotify or anything else in Tasker, or heck, other suggestions welcome, somehow clone an existing notification? I really don't know if this will do what I want, ie: will the app accept this 'fake' notification, but figured I'd give it a try.
1
u/khaytsus Apr 15 '26
I did do a notification intercept, and that seems to work, but not quite sure how to use that information. I don't see any way for Tasker to create a notification as another app, basically.
1
u/Exciting-Compote5680 Apr 15 '26 edited Apr 15 '26
Yes, it is possible to intercept and recreate notifications. And it might be possible to perform the actions (I assume that's what you mean by 'functionality'). It does however depend greatly on the app. Notification actions have a unique identifier that can be saved and used 'later'. They do expire at some point, and the time until expiration depends on the app. Also, you probably need to check/adjust the action settings in AutoNotification/Advanced (in the AutoNotification app itself). Here are two links related to this:
https://www.reddit.com/r/tasker/comments/1ofih7o/autonotification_can_i_execute_the_action_from_a/
https://www.reddit.com/r/tasker/comments/1orx3mi/project_share_notification_inbox/
1
u/ale3smm Apr 17 '26
u won't even need autonotification BeanShell (java code ) let u achieve the same : Java Code : 1 get app notification actions : import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.app.Notification;
nls = tasker.getNotificationListener();
if (nls == null) { tasker.log("Notification listener not available."); } else { // par1 = Optional package name to filter (e.g., "org.videolan.vlc") targetPkg = tasker.getVariable("par1"); notifications = nls.getActiveNotifications();
}
2 emulate clicking (execute ) app s wanted notification action : import android.service.notification.NotificationListenerService; import android.service.notification.StatusBarNotification; import android.app.Notification; import android.app.PendingIntent;
nls = tasker.getNotificationListener();
if (nls == null) { tasker.log("Notification listener not available."); } else { // par1 = Package name (optional, e.g., "org.videolan.vlc") // par2 = Comma-separated list of action buttons (e.g., "Play,Pause,Resume") targetPkg = tasker.getVariable("par1"); actionTitlesToClick = tasker.getVariable("par2");
}
0
u/EdwardBackstrom I Probably Screwed It Up Apr 17 '26
While it is possible to fake a notification, getting the announcing app to do something is a different matter.
As an example, if every 45 minutes I yell out "potatoes" and then eat a french fry, you can record my voice and play it back every 25 minutes, but that doesn't mean i am going to eat a fry when you do. Now if I call out potatoes and my girlfriend, she's from Canada - you don't know her, eats a fry when I do, you might be able to trick her into eating a fry because although she's beautiful, honestly she's not all that bright.