Issues with the Notification Action Block

899 views
Skip to first unread message

Alex Essilfie

unread,
Dec 28, 2015, 6:53:17 PM12/28/15
to Automate
When modifying the Notification Action block, the caption shows "This feature require an Android 4.1+ device" (sic). In the documentation, however, it says "This feature require an Android 4.3+ device" (sic).

Notwithstanding the above mix-up, I do not get anything displayed when I use the notification action block in a flow on my Android 4.3 device. Is there something special to be done in order for the notification action block to be displayed?

Thanks

-----

com.llamalab.automate v1.1.7 on C5303
Sony/C5303/C5303:4.3/12.1.A.1.207/MPt_nw:user/release-keys

Alex Essilfie

unread,
Dec 29, 2015, 5:21:01 AM12/29/15
to Automate
The author responded on another thread here.

The response was as follows:

 
Thanks for reporting. The documentation is incorrect, actions are supported since Android 4.1+ as the notice box say.
Use the Notification show block with proceed "Immediately", then the Notification action block.
If notification aren't working at all, make sure you haven't disabled notifications for Automate in system Apps settings.
 

Alex Essilfie

unread,
Dec 29, 2015, 7:04:04 AM12/29/15
to automa...@googlegroups.com
Having been able to get the extended notifications working, I am left with one major question

Since the Notification show block is set to proceed Immediately, what happens when the flow is being run on an Android 4.0.x device?
Will the flow be paused till the notification is dismissed or will it continue running regardless?
Previously, the Notification Show block would be dismissed when the proceed condition is set to When dismissed.

Another thing I observed was that Android 6+ is required to set the icons on the actions of a Notification Action block.
This strikes me as unusual since many applications (including Automate itself) have icons on their actions.
In the screenshot below, it can be seen that Automate has two icons on the Primary and Secondary action "buttons". Duolingo also has an icon next to it's Follow back action.


Is there any reason why action icons aren't available on Android 4.1 to Android 5?


For your review, I have attached the flow I used to create the notification to the post.

Notification Action Test.flo

Alex Essilfie

unread,
Dec 29, 2015, 7:20:47 AM12/29/15
to Automate

To further press home the point, I found in the Android documentation that the Notification.Builder.addAction method which is available from API Level 16 (Android 4.1 “Jelly Bean”) contains a parameter for specifying the icon on an action.

This brings up two options:

  1. If the standard method is being used to add actions to notifications, kindly allow flow designers to add custom icons on actions on supported platforms (i.e. API Level 16 onwards).
  2. If a custom method is being used, consider using the same means to display actions’ icons.

Finally, is there a means of hiding the icon on an Action? sometimes we don’t want to have any icons next to the actions.

Alex Essilfie

unread,
Dec 29, 2015, 7:32:06 AM12/29/15
to Automate

Additionally, the NotificationCompat.Builder.addAction method also achieves a similar purpose. According to the documentation, using the methods from NotificationCompat.Builder on a non-supported platform has no effect so it is intrinsically safe for use in such a situation.

On platform versions that don’t offer expanded notifications, methods that depend on expanded notifications have no effect.

For example, action buttons won’t appear on platforms prior to Android 4.1. Action buttons depend on expanded notifications, which are only available in Android 4.1 and later.

Could you please look into this so that we get icons on Notification Actions?

Henrik Lindqvist

unread,
Dec 29, 2015, 3:16:51 PM12/29/15
to Automate
Proceed "When dismissed" in the Notification show block has always been available, this block has not been changed, it still works the same for all Android versions.
With proceed "When dismissed" the flow will push until the notification is cancelled or tapped, when proceed "Immediately" the flow will not pause but the notification is still visible until the fiber stops, or is cancelled, etc..

The new Notification action block will fail with an error when used on pre-JellyBean devices.

Prior to Android 6, an icon has to be an actual PNG image resource within the APK, they can't be generated at run-time as Automate does. Automate currently use about 260 icons, including them in 4 different resolutions (mdpi, hdpi, xhpd and xxhdpi) in 3 different styles (standard gray action icon, small white status bar icon and white notification button icon) would make the APK huge, maybe 20MB or more. Neither Google nor users rate such huge APK favorable.

Henrik Lindqvist

unread,
Dec 29, 2015, 3:18:31 PM12/29/15
to Automate
1 & 2 see post https://groups.google.com/d/msg/automate-user/08W1a8nbZ4s/wFDTqFShCgAJ

According to the Android documentation, an notification action requires an icon.

Henrik Lindqvist

unread,
Dec 29, 2015, 3:19:38 PM12/29/15
to Automate
This is why the Notification action block requires Android 4.1+

Alex Essilfie

unread,
Dec 30, 2015, 3:23:36 AM12/30/15
to Automate
Without being too annoying, could I suggest one thing?

What about rendering the resources to PNG in the app's personal folder (/sdcard/Android/data/com.llamalab.automate) and then referencing them from there?
That way you can maintain the application's small size while providing this functionality.

Henrik Lindqvist

unread,
Dec 30, 2015, 4:05:37 PM12/30/15
to Automate
Not possible. A resource, like an image, also need an identifier which is assigned when the app is compiled.

Alex Essilfie

unread,
Dec 30, 2015, 5:48:40 PM12/30/15
to Automate
This seems to be a no-fix then.

I was really excited with the addition of this feature but I don't think I will be using it so much since it doesn't give the desired flexibility.


Just one final request...
Can you rewrite the portion of the code that invokes the Notification Action block so that it is skipped on Android 4.0?
This will allow flows to run without crashing in case they are run on ICS devices. After all, the minimum version required to run the app is Android 4.0.

Henrik Lindqvist

unread,
Dec 30, 2015, 8:38:23 PM12/30/15
to Automate
The notification action buttons work the same on all Android 4.1+ devices, except that the choice of icon is only possible on Android 6+.

Skipping, i.e directly executing the NO path on the Notification action block for Android 4 is not a good solution.
A flow expecting to use action buttons is likely designed in a particular way.
There's many other block that only work for a newer Android version, they aren't silently ignored.
Use the Android version block to check, then use different code paths.

pavel....@gmail.com

unread,
Jan 27, 2016, 2:24:15 PM1/27/16
to Automate
Alex, thanks for the sample. I was struggling making this work.

Cheers,

Pavel
Reply all
Reply to author
Forward
0 new messages