How to create actions in Scriptable notifications?

I’m trying to create some sample actions in my scriptable notification, but it’s not working. Instead, some gap is inserted above the title of the notification. I’m using latest version software. PFA for screenshot.
iPhone X/iOS 14.0.1/Scriptable v1.5.2


fm = FileManager.iCloud();
DOCS_DIR = fm.documentsDirectory();

const delaySeconds = 1;

let currentDate = new Date;
let newDate = new Date(currentDate.getTime() + (delaySeconds * 1000));

if(args.notification) {
    fm.writeString(DOCS_DIR+"/sample.txt", args.queryParameters["key"]);
} else {
  xcall = new CallbackURL("scriptable:///run");
  xcall.addParameter("scriptName", "notifications");
  xcall.addParameter("key", "sample Value");

  ntf= new Notification();
  ntf.title = "Pilot script for notifications";
  ntf.body = "Open this notification for action";
  ntf.sound = "alert";
  ntf.addAction("Action1", "scriptable:///run", true);
  ntf.addAction("Action2", "scriptable:///run?scriptName=notifications", true);


For what it is worth, there is no gap for me on 1.5.1 (167) {beta} on my iPad.

Same result when run from the main screen listing the scripts too.

Have you tried setting the preferredContentHeight attribute on the notification object to see if that gives you the control that you need?

The problem is not the gap. It only appears if I’ve set at least one action for the notification. Otherwise, this gap disappears.

However, I tried preferredContentHeight, and it didn’t work on my device.:smile: