mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2026-04-02 17:40:08 +02:00
✨ Add initial start for scheme integration
This commit is contained in:
@@ -11,8 +11,28 @@ import Foundation
|
|||||||
|
|
||||||
extension AppDelegate {
|
extension AppDelegate {
|
||||||
|
|
||||||
|
/**
|
||||||
|
This is an entry point for future development for integrating with the PHP Monitor
|
||||||
|
application URL. You can use the `phpmon://` protocol to communicate with the app.
|
||||||
|
|
||||||
|
At this time you can trigger the site list using Alfred (or some other application)
|
||||||
|
by opening the following URL: `phpmon://list`.
|
||||||
|
|
||||||
|
Please note that PHP Monitor needs to be running in the background for this to work.
|
||||||
|
*/
|
||||||
func application(_ application: NSApplication, open urls: [URL]) {
|
func application(_ application: NSApplication, open urls: [URL]) {
|
||||||
print(urls)
|
// Only ever interpret the first URL
|
||||||
|
if let url = urls.first {
|
||||||
|
let command = url.absoluteString.replacingOccurrences(of: "phpmon://", with: "")
|
||||||
|
|
||||||
|
switch (command) {
|
||||||
|
case "list":
|
||||||
|
SiteListVC.show()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ extension AppDelegate {
|
|||||||
|
|
||||||
// MARK: - Notifications
|
// MARK: - Notifications
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets up notifications. That does mean we need to ask for permission first.
|
||||||
|
If we cannot get permission, we should log this.
|
||||||
|
*/
|
||||||
public func setupNotifications() {
|
public func setupNotifications() {
|
||||||
let notificationCenter = UNUserNotificationCenter.current()
|
let notificationCenter = UNUserNotificationCenter.current()
|
||||||
notificationCenter.delegate = self
|
notificationCenter.delegate = self
|
||||||
|
|||||||
Reference in New Issue
Block a user