diff --git a/Notifier/.swiftlint.yml b/Notifier/.swiftlint.yml old mode 100644 new mode 100755 index 556de04..5abe087 --- a/Notifier/.swiftlint.yml +++ b/Notifier/.swiftlint.yml @@ -8,11 +8,10 @@ opt_in_rules: # some rules are only opt-in - trailing_newline - colon - comma -included: # paths to include during linting. `--path` is ignored if present. - - auto-update excluded: # paths to ignore during linting. Takes precedence over `included`. - Pods - Scripts/CodeSignUpdate.swift + - Payload # configurable rules can be customized from this configuration file # binary rules can set their severity level diff --git a/Notifier/Notifier - Alerts/Structures.swift b/Notifier/Notifier - Alerts/Structures.swift index b09a075..bb3ca80 100644 --- a/Notifier/Notifier - Alerts/Structures.swift +++ b/Notifier/Notifier - Alerts/Structures.swift @@ -62,7 +62,7 @@ struct RootElements: Codable { struct UserInfo: Codable { // Optional - action to perform when the message is clicked var messageAction: [TaskObject]? - // Optional - alert only - action to perform when the message button is clicked + // Optional - action to perform when the message button is clicked var messageButtonAction: [TaskObject]? // Arguments for the task object struct TaskObject: Codable { diff --git a/Notifier/Notifier - Alerts/UserNotifications.swift b/Notifier/Notifier - Alerts/UserNotifications.swift index 33b625b..c4848d3 100644 --- a/Notifier/Notifier - Alerts/UserNotifications.swift +++ b/Notifier/Notifier - Alerts/UserNotifications.swift @@ -259,13 +259,13 @@ func processNotificationActions(userInfoKey: String, userInfo: [AnyHashable: Any """) // If task failed to run } else { - // Post error - postToNSLogAndStdOut(logLevel: "ERROR", logMessage: - """ - Running: \(messageActionDict["taskPath"] ?? "") - \(messageActionDict["taskArguments"] ?? []) failed with \(taskOutput). - """, functionName: #function.components(separatedBy: "(")[0], - verboseMode: "enabled") + // Post error + postToNSLogAndStdOut(logLevel: "ERROR", logMessage: + """ + Running: \(messageActionDict["taskPath"] ?? "") + \(messageActionDict["taskArguments"] ?? []) failed with \(taskOutput). + """, functionName: #function.components(separatedBy: "(")[0], + verboseMode: "enabled") } } } diff --git a/Notifier/Notifier - Notifications/AppDelegate.swift b/Notifier/Notifier - Notifications/AppDelegate.swift index 13e2da6..90d773c 100644 --- a/Notifier/Notifier - Notifications/AppDelegate.swift +++ b/Notifier/Notifier - Notifications/AppDelegate.swift @@ -82,6 +82,16 @@ func processArguments(messageContent: MessageContent, notificationCenter: UNUser notificationContent.userInfo["messageAction"] = getNotificationBodyAction(messageContent: messageContent, rootElements: rootElements) } + // messageButton needs defining, even when not called. So processing it here along with messageButtonAction + let (tempMessageButtonAction, tempCategory) = processMessageButton(notificationCenter: notificationCenter, + messageContent: messageContent, rootElements: rootElements) + // Set the notifications category + notificationCenter.setNotificationCategories([tempCategory]) + // If tempMessageButtonAction has a value + if !tempMessageButtonAction.isEmpty { + // Add messageButtonAction to userInfo + notificationContent.userInfo["messageButtonAction"] = tempMessageButtonAction + } // If we have a value for messageSound passed if messageContent.messageSound != nil { // Set the notifications sound diff --git a/Notifier/Notifier - Notifications/Functions.swift b/Notifier/Notifier - Notifications/Functions.swift index 9832cec..31ed0e5 100644 --- a/Notifier/Notifier - Notifications/Functions.swift +++ b/Notifier/Notifier - Notifications/Functions.swift @@ -87,7 +87,7 @@ func gracefulLogout(userInfo: [AnyHashable: Any]) { // Progress log NSLog("\(#function.components(separatedBy: "(")[0]) - logout prompting") } - // Create an NSAppleScript object wiht the logout command + // Create an NSAppleScript object with the logout command if let scriptObject = NSAppleScript(source: "tell application \"loginwindow\" to «event aevtlogo»") { // If we receive output from the prior command if let outputString = scriptObject.executeAndReturnError(&error).stringValue { diff --git a/Notifier/Notifier - Notifications/Structures.swift b/Notifier/Notifier - Notifications/Structures.swift index f1bc967..9953476 100644 --- a/Notifier/Notifier - Notifications/Structures.swift +++ b/Notifier/Notifier - Notifications/Structures.swift @@ -11,6 +11,10 @@ struct MessageContent: Codable { var messageAction: [TaskObject]? // The notifications message (required) var messageBody: String? + // Optional - message button label + var messageButton: String? + // Optional - action to perform when the message button is clicked + var messageButtonAction: [TaskObject]? // Optional - the sound played when the notification has been delivered var messageSound: String? // Optional - the notifications subtitle @@ -25,10 +29,13 @@ struct MessageContent: Codable { var taskArguments: [String]? } // Initialize MessageContent - init(messageAction: [TaskObject]? = nil, messageBody: String? = nil, messageSound: String? = nil, - messageSubtitle: String? = nil, messageTitle: String? = nil) { + init(messageAction: [TaskObject]? = nil, messageBody: String? = nil, messageButton: String? = nil, + messageButtonAction: [TaskObject]? = nil, messageSound: String? = nil, messageSubtitle: String? = nil, + messageTitle: String? = nil) { self.messageAction = messageAction self.messageBody = messageBody + self.messageButton = messageButton + self.messageButtonAction = messageButtonAction self.messageSound = messageSound self.messageSubtitle = messageSubtitle self.messageTitle = messageTitle @@ -55,6 +62,8 @@ struct RootElements: Codable { struct UserInfo: Codable { // Optional - action to perform when the message is clicked var messageAction: [TaskObject]? + // Optional - action to perform when the message button is clicked + var messageButtonAction: [TaskObject]? // Arguments for the task object struct TaskObject: Codable { // The tasks executable @@ -63,7 +72,8 @@ struct UserInfo: Codable { var taskArguments: [String]? } // Initialize ParsedArguments - init(messageAction: [TaskObject]? = nil) { + init(messageAction: [TaskObject]? = nil, messageButtonAction: [TaskObject]? = nil) { self.messageAction = messageAction + self.messageButtonAction = messageButtonAction } } diff --git a/Notifier/Notifier - Notifications/UserNotifications.swift b/Notifier/Notifier - Notifications/UserNotifications.swift index 6938c1d..3c514f4 100644 --- a/Notifier/Notifier - Notifications/UserNotifications.swift +++ b/Notifier/Notifier - Notifications/UserNotifications.swift @@ -134,6 +134,60 @@ func handleNotification(forResponse response: UNNotificationResponse) { exit(0) } +// Adds messageButton (always needed) and messageButtonAction (when defined) +func processMessageButton(notificationCenter: UNUserNotificationCenter, messageContent: MessageContent, + rootElements: RootElements) -> + ([AnyHashable: Any], UNNotificationCategory) { + // Var declaration + var tempCategory = UNNotificationCategory(identifier: "banner", actions: [], intentIdentifiers: [], + options: .customDismissAction) + var messageButtonAction = [AnyHashable: Any]() + // If we have a value for messageButton passed + if messageContent.messageButton != nil { + // Create an action object + let notificationAction = UNNotificationAction(identifier: "messagebutton", + title: messageContent.messageButton ?? "", + options: []) + // Amend tempCategory + tempCategory = UNNotificationCategory(identifier: "banner", actions: [notificationAction], + intentIdentifiers: [], + options: .customDismissAction) + // If verbose mode is enabled + if rootElements.verboseMode != nil { + // Progress log + NSLog("\(#function.components(separatedBy: "(")[0]) - messagebutton processed") + } + // If we have a values for messageButton and messageButtonAction passed + if messageContent.messageButtonAction != nil { + // Add taskPath from messagAction to messageButtonAction + messageButtonAction["taskPath"] = messageContent.messageButtonAction?[0].taskPath + // Add taskArguments from messageButtonAction + messageButtonAction["taskArguments"] = + messageContent.messageButtonAction?[0].taskArguments + // If verbose mode is enabled + if rootElements.verboseMode != nil { + // Progress log + NSLog(""" + \(#function.components(separatedBy: "(")[0]) - messageButtonAction - taskPath: \ + \(messageButtonAction["taskPath"] ?? ""), + taskArguments: \(messageButtonAction["taskArguments"] ?? []) + """) + } + // Return tempCategory and tempUserInfo + return (messageButtonAction, tempCategory) + } + // If we don't have a value for messageButton + } else { + // If verbose mode is enabled + if rootElements.verboseMode != nil { + // Progress log + NSLog("\(#function.components(separatedBy: "(")[0]) - no messagebutton defined") + } + } + // Return empty userInfo for messageButtonAction and tempCategory + return ([:], tempCategory) +} + // Post the notification func postNotification(notificationCenter: UNUserNotificationCenter, notificationContent: UNMutableNotificationContent, messageContent: MessageContent, passedBase64: String, rootElements: RootElements) { @@ -207,11 +261,11 @@ func processNotificationActions(userInfoKey: String, userInfo: [AnyHashable: Any } else { // Post error postToNSLogAndStdOut(logLevel: "ERROR", logMessage: - """ - Running: \(messageActionDict["taskPath"] ?? "") - \(messageActionDict["taskArguments"] ?? []) failed with \(taskOutput). - """, functionName: #function.components(separatedBy: "(")[0], - verboseMode: "enabled") + """ + Running: \(messageActionDict["taskPath"] ?? "") + \(messageActionDict["taskArguments"] ?? []) failed with \(taskOutput). + """, functionName: #function.components(separatedBy: "(")[0], + verboseMode: "enabled") } } } diff --git a/Notifier/Notifier.xcodeproj/project.pbxproj b/Notifier/Notifier.xcodeproj/project.pbxproj index a607ec3..b0fef11 100644 --- a/Notifier/Notifier.xcodeproj/project.pbxproj +++ b/Notifier/Notifier.xcodeproj/project.pbxproj @@ -208,11 +208,11 @@ 7C6D15762270BA2F0092D34E /* Resources */, 7CF89A4023BF9F6000723A3B /* CopyFiles */, 7CAB609623DF4C8B0029E310 /* CopyFiles */, + 84CC99F32C21904900396D3F /* Swiftlint */, ); buildRules = ( ); dependencies = ( - 845D68DE2B692A2900C5B467 /* PBXTargetDependency */, 84FA749C2B61C9D9009B4068 /* PBXTargetDependency */, 84E1A6CA2B61C02C00D7F7C9 /* PBXTargetDependency */, ); @@ -235,7 +235,6 @@ buildRules = ( ); dependencies = ( - 84524FD12B61BC280046367B /* PBXTargetDependency */, ); name = "Notifier - Notifications"; packageProductDependencies = ( @@ -255,7 +254,6 @@ buildRules = ( ); dependencies = ( - 84E1A6C62B61C01600D7F7C9 /* PBXTargetDependency */, ); name = "Notifier - Alerts"; packageProductDependencies = ( @@ -272,7 +270,7 @@ attributes = { BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 1520; - LastUpgradeCheck = 1520; + LastUpgradeCheck = 1600; ORGANIZATIONNAME = "dataJAR Ltd"; TargetAttributes = { 7C6D15772270BA2F0092D34E = { @@ -305,7 +303,6 @@ ); mainGroup = 7C6D156F2270BA2F0092D34E; packageReferences = ( - 845D68DA2B692A1700C5B467 /* XCRemoteSwiftPackageReference "SwiftLint" */, 845D68DF2B692A4800C5B467 /* XCRemoteSwiftPackageReference "swift-argument-parser" */, ); productRefGroup = 7C6D15792270BA2F0092D34E /* Products */; @@ -349,6 +346,28 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 84CC99F32C21904900396D3F /* Swiftlint */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + ); + name = Swiftlint; + outputFileListPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# If the dir /opt/homebrew/bin/ exists\nif [ -d '/opt/homebrew/bin/' ]\nthen\n # Add homebrew dir to PATH\n PATH=\"/opt/homebrew/bin/:${PATH}\"\nfi\n\n# Get path so swiftlint (if installed)\nswiftlintPath=$(which swiftlint)\n\n# If we can find swiftlint\nif [ -n \"${swiftlintPath}\" ]\nthen\n # Run swiftlint\n swiftlint\n# If we can't find swiftlint\nelse\n # Log error\n /bin/echo \"ERROR: SwiftLint not installed, exiting...\"\n # Exit\n exit 1\nfi\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 7C6D15742270BA2F0092D34E /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -387,18 +406,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 84524FD12B61BC280046367B /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - productRef = 84524FD02B61BC280046367B /* SwiftLintPlugin */; - }; - 845D68DE2B692A2900C5B467 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - productRef = 845D68DD2B692A2900C5B467 /* SwiftLintPlugin */; - }; - 84E1A6C62B61C01600D7F7C9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - productRef = 84E1A6C52B61C01600D7F7C9 /* SwiftLintPlugin */; - }; 84E1A6CA2B61C02C00D7F7C9 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 84E1A6B72B61C00400D7F7C9 /* Notifier - Alerts */; @@ -473,7 +480,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; @@ -545,7 +552,7 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -579,7 +586,6 @@ 7C6D15872270BA300092D34E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; @@ -592,6 +598,7 @@ DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = 82K2XFN8L6; ENABLE_HARDENED_RUNTIME = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = Notifier/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; @@ -600,7 +607,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; + MARKETING_VERSION = 3.1; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = uk.co.dataJAR.Notifier; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -614,7 +621,6 @@ 7C6D15882270BA300092D34E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ARCHS = "$(ARCHS_STANDARD)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; @@ -627,6 +633,7 @@ DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = 82K2XFN8L6; ENABLE_HARDENED_RUNTIME = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; INFOPLIST_FILE = Notifier/Info.plist; INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities"; INFOPLIST_KEY_LSUIElement = YES; @@ -635,7 +642,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; + MARKETING_VERSION = 3.1; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = uk.co.dataJAR.Notifier; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -672,7 +679,7 @@ ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; + MARKETING_VERSION = 3.1; NEW_SETTING = ""; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = uk.co.dataJAR.NotifierNotifications; @@ -711,7 +718,7 @@ ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; + MARKETING_VERSION = 3.1; NEW_SETTING = ""; PRODUCT_BUNDLE_IDENTIFIER = uk.co.dataJAR.NotifierNotifications; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -747,7 +754,7 @@ ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; + MARKETING_VERSION = 3.1; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = uk.co.dataJAR.NotifierAlerts; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -783,7 +790,7 @@ ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 3.0; + MARKETING_VERSION = 3.1; PRODUCT_BUNDLE_IDENTIFIER = uk.co.dataJAR.NotifierAlerts; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -834,22 +841,6 @@ /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ - 841F5F3C2B618C1500473103 /* XCRemoteSwiftPackageReference "SwiftLint" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/realm/SwiftLint.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 0.54.0; - }; - }; - 845D68DA2B692A1700C5B467 /* XCRemoteSwiftPackageReference "SwiftLint" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/realm/SwiftLint.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 0.54.0; - }; - }; 845D68DF2B692A4800C5B467 /* XCRemoteSwiftPackageReference "swift-argument-parser" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/apple/swift-argument-parser.git"; @@ -861,26 +852,11 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 84524FD02B61BC280046367B /* SwiftLintPlugin */ = { - isa = XCSwiftPackageProductDependency; - package = 841F5F3C2B618C1500473103 /* XCRemoteSwiftPackageReference "SwiftLint" */; - productName = "plugin:SwiftLintPlugin"; - }; - 845D68DD2B692A2900C5B467 /* SwiftLintPlugin */ = { - isa = XCSwiftPackageProductDependency; - package = 845D68DA2B692A1700C5B467 /* XCRemoteSwiftPackageReference "SwiftLint" */; - productName = "plugin:SwiftLintPlugin"; - }; 845D68E02B692A5100C5B467 /* ArgumentParser */ = { isa = XCSwiftPackageProductDependency; package = 845D68DF2B692A4800C5B467 /* XCRemoteSwiftPackageReference "swift-argument-parser" */; productName = ArgumentParser; }; - 84E1A6C52B61C01600D7F7C9 /* SwiftLintPlugin */ = { - isa = XCSwiftPackageProductDependency; - package = 841F5F3C2B618C1500473103 /* XCRemoteSwiftPackageReference "SwiftLint" */; - productName = "plugin:SwiftLintPlugin"; - }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 7C6D15702270BA2F0092D34E /* Project object */; diff --git a/Notifier/Notifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Notifier/Notifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 2c9be40..56417ed 100644 --- a/Notifier/Notifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Notifier/Notifier.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,32 +1,6 @@ { + "originHash" : "59ba1edda695b389d6c9ac1809891cd779e4024f505b0ce1a9d5202b6762e38a", "pins" : [ - { - "identity" : "collectionconcurrencykit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git", - "state" : { - "revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95", - "version" : "0.2.0" - } - }, - { - "identity" : "cryptoswift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", - "state" : { - "revision" : "7892a123f7e8d0fe62f9f03728b17bbd4f94df5c", - "version" : "1.8.1" - } - }, - { - "identity" : "sourcekitten", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/SourceKitten.git", - "state" : { - "revision" : "b6dc09ee51dfb0c66e042d2328c017483a1a5d56", - "version" : "0.34.1" - } - }, { "identity" : "swift-argument-parser", "kind" : "remoteSourceControl", @@ -35,52 +9,7 @@ "revision" : "8f4d2753f0e4778c76d5f05ad16c74f707390531", "version" : "1.2.3" } - }, - { - "identity" : "swift-syntax", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", - "state" : { - "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", - "version" : "509.0.2" - } - }, - { - "identity" : "swiftlint", - "kind" : "remoteSourceControl", - "location" : "https://github.com/realm/SwiftLint.git", - "state" : { - "revision" : "f17a4f9dfb6a6afb0408426354e4180daaf49cee", - "version" : "0.54.0" - } - }, - { - "identity" : "swiftytexttable", - "kind" : "remoteSourceControl", - "location" : "https://github.com/scottrhoyt/SwiftyTextTable.git", - "state" : { - "revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", - "version" : "0.9.0" - } - }, - { - "identity" : "swxmlhash", - "kind" : "remoteSourceControl", - "location" : "https://github.com/drmohundro/SWXMLHash.git", - "state" : { - "revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f", - "version" : "7.0.2" - } - }, - { - "identity" : "yams", - "kind" : "remoteSourceControl", - "location" : "https://github.com/jpsim/Yams.git", - "state" : { - "revision" : "0d9ee7ea8c4ebd4a489ad7a73d5c6cad55d6fed3", - "version" : "5.0.6" - } } ], - "version" : 2 + "version" : 3 } diff --git a/Notifier/Notifier.xcodeproj/xcshareddata/xcschemes/Notifier.xcscheme b/Notifier/Notifier.xcodeproj/xcshareddata/xcschemes/Notifier.xcscheme index c94209c..95314f8 100644 --- a/Notifier/Notifier.xcodeproj/xcshareddata/xcschemes/Notifier.xcscheme +++ b/Notifier/Notifier.xcodeproj/xcshareddata/xcschemes/Notifier.xcscheme @@ -1,6 +1,6 @@ Licensed under the Apache License, Version 2.0 -Copyright 2024 DATA JAR LTD +Copyright 2024 Jamf LTD Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @@ -17,7 +17,7 @@ Notifications are delivered via the [UserNotifications Framework](https://develo # Usage ## Basic Usage ``` -OVERVIEW: Notifier 3.0: Posts alert or banner notifications. +OVERVIEW: Notifier 3.1: Posts alert or banner notifications. USAGE: --type --message --type --remove prior @@ -42,27 +42,11 @@ OPTIONS: For example: "/usr/bin/open" will work, "open" will not. - --sound The sound to play when notification is delivered. - Pass "default" for the default macOS sound, else the - name of a sound in /Library/Sounds or - /System/Library/Sounds. - - If the sound cannot be found, macOS will use the - "default" sound. - - --subtitle The notifications subtitle. - - --title The notifications title. - --messagebutton <messagebutton> - alert type only. - Adds a button to the message, with the label being what is passed. --messagebuttonaction <messagebuttonaction> - alert type only. - The action to be performed under the users account when the optional message button is clicked. @@ -90,6 +74,18 @@ OPTIONS: message will be required too. Including all passed flags. + --sound <sound> The sound to play when notification is delivered. + Pass "default" for the default macOS sound, else the + name of a sound in /Library/Sounds or + /System/Library/Sounds. + + If the sound cannot be found, macOS will use the + "default" sound. + + --subtitle <subtitle> The notifications subtitle. + + --title <title> The notifications title. + --verbose Enables logging of actions. Check console for 'Notifier' messages. diff --git a/package/make-notifier-pkg.sh b/package/make-notifier-pkg.sh index d165dc3..4e12fd7 100755 --- a/package/make-notifier-pkg.sh +++ b/package/make-notifier-pkg.sh @@ -39,7 +39,7 @@ scriptExtension=${0##*.} swTitle="$(/usr/bin/basename "$0" ."$scriptExtension")" # Script Version -ver="1.0" +ver="1.0.1" # Full path to the dir this script is in scriptDir="$(/usr/bin/dirname "$0")" @@ -149,8 +149,7 @@ USAGE: Ths script needs to be ran as root/sudo, and requires the following argum https://developer.apple.com/help/account/create-certificates/create-developer-id-certificates/ \$2 - Name of an App-specific password within the running users keychain, to be used for notarization: https://support.apple.com/en-us/102654 - \$3 - pkg receipt identifier - uk.dataJAR.Notifier + \$3 - pkg receipt identifier (for example: uk.dataJAR.Notifier) " }