diff --git a/notif.js b/notif.js index 88cfea3..82db0e2 100644 --- a/notif.js +++ b/notif.js @@ -1,12 +1,26 @@ - const n = new Notification() +// Passing Arguments here let textVar = args.plainTexts.toString() -n.title = "" -n.subtitle = textVar.split(",")[0] -n.body = textVar.split(",")[1] +n.title = "Emploi du temps 📚" +n.subtitle = "" + +// Avoid error for passed args +if(textVar === null || textVar === undefined || textVar === ""){ + n.body = "Aucun résultat" +}else{ + n.body = textVar.split(",")[1] +} + +n.threadIdentifier = "Emploi du temps" + +ENT_url = "https://ent.istp-france.com/ENT/Eleve/MonPlanning.aspx"; + +n.openURL = ENT_url + +// Add action when the notification is held : haptic touch (Apple) +n.addAction("Ouvrir l'ENT", ENT_url, false) -n.threadIdentifier = "Notifications" n.schedule() -Script.complete() \ No newline at end of file +Script.complete()