User Notifications

RSS for tag

Push user-facing notifications to the user's device from a server or generate them locally from your app using User Notifications.

Posts under User Notifications tag

160 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Seeking guidance on intercepting system-wide notifications in macOS app
I'm developing a macOS application called Blurt, which aims to provide enhanced notification management in MacOS. The core functionality I'm trying to implement is the ability to intercept and display notifications from various applications in a custom interface. Current implementation: Using AppDelegate to handle application lifecycle Implemented UNUserNotificationCenterDelegate for handling notifications Created a custom NotificationService extension Challenges: Unable to intercept notifications from other applications System notifications are not being captured by our app What I've tried: Using DistributedNotificationCenter to observe system-wide notifications Implementing a Notification Service Extension Exploring NSWorkspace notifications Current roadblocks: Apple's sandboxing and security model seems to prevent direct access to other apps' notifications Unable to find a sanctioned API for system-wide notification interception Questions: Is there a recommended approach to creating a centralized notification management system within Apple's guidelines? Are there any specific system notifications or events we can legally subscribe to that might help achieve similar functionality? How do other notification management apps (if any exist) handle this limitation? Are there any upcoming APIs or features in macOS that might address this use case? I'm open to alternative approaches or pivoting the app's functionality if necessary. Any insights, suggestions, or resources would be greatly appreciated. Thank you in advance for your help!
0
0
79
1d
iOS Push to Talk Framework Not Working in Archive Build (Flutter)
I have developed an app using Flutter that utilizes the Push to Talk framework on iOS. The Push to Talk feature works perfectly in debug mode, but after archiving the build and installing it on an iOS 17 device, the Push to Talk functionality stops working. Here are the steps I have already taken: Enabled background modes. Enabled Push to Talk capabilities. Despite these settings, the issue persists in the archive build. Has anyone else encountered this issue? What additional steps or configurations are required to get Push to Talk working in the archive build on iOS 17? Any help or guidance would be greatly appreciated. Thank you!
1
0
100
4d
Push Notification User to User
Hello everyone, I'm getting desperate... I have built a small chat app and just can't get the other person to receive a push notification outside the app. Does anyone have a code snippet or an idea how I can solve this? I'm getting desperate! I have already tried a lot, the best would be a local solution where the message is triggered when the user receives a new message. I would be happy to receive code snippets or tips. Sending via OneSignal works, but as I said, I just can't get the user to user messages to work!
1
0
120
1w
Using Genmoji with local notifications
As per subject. Is this possible at all? The WWDC video only talks about the communication / push notifications. There doesn't seem to be any update to UNNotificationContent to allow setting of attributed strings. If your app makes use of communication notifications you can even include Genmoji and other image glyphs in your notifications with the new "UNNotificationAttributed MessageContext API". For push notifications, the payload just needs to contain a rich text representation that may contain image glyphs. We recommend that you use a Notification Service Extension to parse the rich text, download assets, create the attributed body and update the notification content
1
0
134
1w
Notification filtering entitlement - no response from apple
For a few years now, I have submitted requests for com.apple.developer.usernotifications.filtering entitlement, but never got an approval/denial response from apple. even after contacting them via email, still didn't get a response about the request status. our app is an emergency alerts app, this entitlement is crucial for our app reliability. Last request i have sent has Case-ID: 7377207
0
0
125
2w
Experiencing Duplicate Notifications Issue Recently By Multiple Users
We recently noticed that our app is receiving duplicate notifications, and this is impacting multiple users, and we verified from our server that we are sending the notifications only once This is a sample payload of the notifications we are sending { "aps": { "alert": { "title": "title", "body": "body" }, "category": "test", "mutable-content": 1 }, "navigateTo": "test", "imageUrl": "test" } Also a user with IOS 17.5.1 reported this issue also
2
0
189
2w
Issue with Locale Updates on Network Extension in iOS
I have implemented a NEPacketTunnelProvider in my app, which sends local notifications to the user when the server is down. While the notifications are displayed successfully, I encountered an issue when changing the system locale settings on iOS. Specifically, the notifications still display in the previous locale, even after the system locale has been changed. The locale of the notifications only updates if I restart the device. I am currently using Locale.current for setting the locale in my notifications. I have also tried using Locale.preferredLanguages, but it seems that the locale does not properly update in real-time.
4
0
153
2w
URLSession download task fails with NSPOSIXErrorDomain error Code=1
I have a Push Notification Service Extension, which is processing notification payload to attach image, if imageUrl is key is present. I use this simple code to perform the download: let downloadTask = URLSession.shared.downloadTask(with: urlRequest) { [weak self] tempURL, response, error in /// parse results... } Notification payload contains "mutable-content" : 1 inside aps. It's entirely randomly will it work or not. When it doesn't work, I get this error: Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted" UserInfo={NSErrorFailingURLStringKey=https://w7.pngwing.com/pngs/1005/607/png-transparent-african-elephant-animal-elephant-thumbnail.png, NSErrorFailingURLKey=https://w7.pngwing.com/pngs/1005/607/png-transparent-african-elephant-animal-elephant-thumbnail.png, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDownloadTask <4A847242-2314-4125-99E4-A424CF4B4B7C>.<7>" ), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <4A847242-2314-4125-99E4-A424CF4B4B7C>.<7>} I have no idea what Apple's internal code throws this error, what could possibly go wrong here. This is happening for a while now, I just re-tested on iOS 17.5.1 on 14 Pro. App is compiled using Xcode 15.4 and Swift 5.10, latest SDK. Not sure is it relevant but main iOS app has DataProtection capability set to Complete.
9
0
200
2w
Scheduling Local Notifications with repeat interval
I am building an application where I need to implement a use case where a local notification is set for a specific date / time (e.g 05/6/24 8 PM) to display to the user (e.g. "Take your Meds") and I want him to continue to get that alert every X minutes (e.g. every 2 minutes) until I cancel it (e.g. when the user indicates he has taken his medicene). NOTE: I do NOT want to rely on push notifications from the server for doing the reminders because it needs to work when the device is off the network (like on a plane or a cruise ship in the middle of the ocean or whatever). This would seem to be a pretty common use case, but looking at the previous and existing local notification frameworks, I only see the option to create a calendar based trigger with a boolean repeat (UNCalendarNotificationTrigger) or a time interval based trigger with a boolean repeat (UnTimeIntervalNotificationTrigger), but nothing that combines these in a way that allows me to implement the above stated use case.
1
0
213
May ’24
Push Notifications
Hi, I am trying to add in a push notification but the send push notifications function does not seem to be working. Can someone help? func sendNotification() { print("Bluetooth device disconnected. Sending notification.") let content = UNMutableNotificationContent() content.title = "Car Disconnected" content.body = "Please key in where you have left your car" content.sound = UNNotificationSound.default // Create a trigger to send the notification immediately let request = UNNotificationRequest(identifier: "BluetoothDisconnected", content: content, trigger: nil) UNUserNotificationCenter.current().add(request) { error in if let error = error { print("Error adding notification request: \(error.localizedDescription)") } else { print("Notification request added successfully.") } } }
1
0
247
May ’24
Provisional Notifications missing buttons
We are attempting to enable provisional notifications in our app, but some internal users on iOS 17 are reporting that they are not receiving the "Keep" and "Turn off" buttons that provisional notifications are supposed to have - in other words they just come in as regular quiet notifications. I have confirmed that these users are doing a fresh install of our app, and at no point are they ever receiving a permission prompt to turn on notifications. Their UNAuthorizationStatus is correctly being set to provisional. Their notification settings are being set to the following, which seems correct: I have not been able to reproduce this issue on any of my own devices, but these users can do so consistently. What could possibly cause this? Some misconfiguration on our end, our some hidden iOS setting somewhere?
1
0
235
May ’24
ios push notification not received after getting out of airplane mode
I'm sending a push notification using Noticed Gem during the night when my phone is in airplane mode. When I wake up and disable the airplane mode, I don't get the push notification. These are the settings: ` def ios_format(apn) apn.custom_payload = { universal_link: url } apn.alert = { title: title(recipient), body: message(recipient) } apn.sound = 'default' apn.priority = '10' # Send immediately, bypassing the end ` default expiration is supposed to be 30 days. How can I debug/fix the problem? (with noticed gem) I checked Apple consoleKIT, and I don't see discarded notifications. Thanks
3
0
395
May ’24
Notification not sending
Hello There!, I'm currently working on an App with an implemented timer. It was initially planned, that the User will get a notification when the timer ends. Everything works fine until the timer ends and the phone doesn't gets any notification... This is my code: import SwiftUI import Combine import UserNotifications struct TimerView: View { @State private var timeRemaining: TimeInterval @State private var timerActive = false @Binding var studyTime: Int @Binding var selectedExam: Exam init(studyTime: Binding<Int>, selectedExam: Binding<Exam>) { _studyTime = studyTime _selectedExam = selectedExam _timeRemaining = State(initialValue: TimeInterval(studyTime.wrappedValue * 60)) } var body: some View { VStack { ZStack { Circle() .trim(from: 0, to: CGFloat(timeRemaining / (TimeInterval(studyTime * 60)))) .stroke(Color.purple, lineWidth: 15) .rotationEffect(.degrees(-90)) .animation(.linear(duration: 1)) .padding(40) Text("\(timeRemaining.formattedTime)") .font(.system(size: 50)) } Button(action: { self.timerActive.toggle() }) { Text(timerActive ? "Stop" : "Start") .font(.title) .padding() } .foregroundColor(.white) .background(timerActive ? Color.red : Color.green) .cornerRadius(10) .padding() } .onReceive(timer) { _ in guard self.timerActive else { return } if self.timeRemaining > 0 { self.timeRemaining -= 1 } else { self.timerActive = false sendNotification() } print("Time Remaining: \(self.timeRemaining)") } .navigationTitle($selectedExam.wrappedValue.subject) .navigationBarBackButtonHidden(true) .onDisappear { // Actions if the timer View disappears } } var timer: AnyPublisher<Date, Never> { Timer.TimerPublisher(interval: 1.0, runLoop: .main, mode: .default) .autoconnect() .eraseToAnyPublisher() } func sendNotification() { let content = UNMutableNotificationContent() content.title = "Lernzeit vorbei" content.body = "Deine Lernzeit für \(selectedExam.subject) ist abgelaufen!" content.sound = UNNotificationSound.default let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false) let request = UNNotificationRequest(identifier: "timerNotification", content: content, trigger: trigger) UNUserNotificationCenter.current().add(request) { error in if let error = error { print("Fehler beim Hinzufügen der Benachrichtigung zur Warteschlange: \(error.localizedDescription)") } else { print("Benachrichtigung zur Warteschlange hinzugefügt") } } } } extension TimeInterval { var formattedTime: String { let minutes = Int(self) / 60 % 60 let seconds = Int(self) % 60 return String(format: "%02i:%02i", minutes, seconds) } } I looked it up and the app is allowed to send every type of notification... (this is initialized in another part of the code)
2
0
286
May ’24
Hide local notification alert when app is terminated.
I schedule a local notification to remind me to check in at work at 8 am if I am not already checked in, the code is working fine when app is in foreground, but when I kill the app, it alway show alert no matter if I already checked in or not. func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { let isCheckedIn = AppManager.shared.isCheckedIn() if isCheckedIn { completionHandler([]) } else { completionHandler([.list, .sound, .banner]) } }
0
0
203
May ’24
apn-environment in Testfligh stuck on Production
Steps to reproduce: Install & Launch App When push notifications are registered, the push notification token received is a "production" push notification token rather than a "development" push notification token. We are trying to test on the sandbox environment with development push notification tokens, however the apn-environment for all builds we release via TestFlight are being set to "production". We wish to distribute builds via TestFlight with apn-environment set to "development". At the moment we have only found one way to run the app with apn-environment set to "development" which is to "Export" a Debug build, then manually install it on a device via iTunes on Windows machines. This method is not efficient or considered seamless enough for non-technical testers and stakeholders. They require a seamless way to receive Debug builds via TestFlight without resorting to other third-party platforms which allow us to manually upload the "Exported Debug build". If anyone knows how to upload a "Debug" build to Testflight which will allow the user to receive a sandbox development push token with "apn-environment" set to development I would really appreciate it.
1
0
272
May ’24