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
notifications.js
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");
console.log(xcall.getURL());
ntf= new Notification();
ntf.openURL=xcall.getURL();
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);
ntf.setTriggerDate(newDate);
ntf.schedule();
}
Script.complete()