send event from the code that actaully received the notification

This commit is contained in:
Tom Caputi 2023-10-30 16:35:54 -04:00
parent 93a240dad8
commit f2dd5fb3f1
2 changed files with 4 additions and 2 deletions

View file

@ -542,7 +542,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
APP_BASE_URL = "http://192.168.1.7";
APP_BASE_URL = "http://192.168.105.215";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ntfy/ntfy.entitlements;
@ -578,7 +578,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
APP_BASE_URL = "http://192.168.1.7";
APP_BASE_URL = "http://192.168.105.215";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = ntfy/ntfy.entitlements;

View file

@ -97,6 +97,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
) {
let userInfo = notification.request.content.userInfo
Log.d(tag, "Notification received via userNotificationCenter(willPresent)", userInfo)
NotificationCenter.default.post(name: .notificationReceived, object: nil)
completionHandler([[.banner, .sound]])
}
@ -129,6 +130,7 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
NotificationCenter.default.post(name: .notificationReceived, object: nil)
completionHandler()
}
}