Notification Center

RSS for tag

Create and manage app extensions that implement Today widgets using Notification Center.

Notification Center Documentation

Posts under Notification Center tag

72 Posts
Sort by:
Post not yet marked as solved
0 Replies
110 Views
Dear Apple support, We are working on one of the projects related to BLE, in which our BLE device is acting as a GATT client and our iPhone device (iPhone 13, OS17.3) is acting as a GATT server. Issue being faced: Whenever my BLE device subscribes to the ANCS notifications, and the moment the IOS device starts bombarding with the notifications available in notification center, the BLE device controller's heap memory becomes UNAVAILABLE in runtime for this notifications' queue and eventually making the BLE controller to reset. Thereafter, whenever user tries making a new connection session of BLE, again same thing repeats. Notifications allowed in BLE display : W-SMS, W-CALL, SMS, CALL, none other than this. Issue observed with : IF and ONLY 150 notifications and above available in notification center, otherwise our product works fine with iPhone with less number of notifications. We would like to know how we can curb the number of PRE-EXISTING type notifications available in the notification center flowing towards the BLE device? What best solution can be done at the IOS side, we also have IOS APP team for this project. What kind of APIs does Core Bluetooth framework can provide to the IOS developer in order to overcome this issue. Please suggest possible ways from the IPHONE device only to overcome this. BLE's software CANNOT BE CHANGED under any circumstances as the product is already in production and complaints are coming from end user (from the field). OUR GOAL : ONLY notifications which will be available in run time, i.e. AFTER SUCCESSFUL BLE connection established to be displayed in the BLE's display. We DON'T WANT older notifications to be displayed and flow towards BLE over ANCS. WE MUST make 'notification popup' option as ALLOW to be shared with our BLE device, otherwise SMS,CALL, W-SMS,W-CALL during live connection will not come on the BLE 's display.
Posted
by MM_GGN.
Last updated
.
Post marked as solved
3 Replies
309 Views
Both the extension and the receiving application are in the same app group. I can't find the issue. It doesn't seem to be a problem with entitlements. Maybe an issue with the string formatting/conversion? Maybe I am not allowed to send distributed center notifications from the camera extension? I am sending the notification calling: func notifyChangeInUsage() { os_log("Notifying the virtual camera change in usage", log: cdsLog, type: .info) // this is logged DistributedNotificationCenter.default().postNotificationName(NSNotification.Name("VirtualCamUsageChanged"), object: nil, userInfo: nil, deliverImmediately: true) } And receiving it in the other end, subscribing with std::string notification = "VirtualCamUsageChanged" [mObserverClassInstance subscribe:@(notification.c_str())]; where subscribe is the following method, which is tested to be working. - (void)subscribe:(NSString *)notification { [[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(callCallback:) name:notification object:nil suspensionBehavior:NSNotificationSuspensionBehaviorDeliverImmediately]; }
Posted Last updated
.
Post not yet marked as solved
0 Replies
230 Views
The Notification provides the uuid corresponding to the Item saved in SwiftData. Goal is to open the correct DetailItem View when I tap the notification. How can I achieve this? @Model final class Item { @Attribute(.unique) var uuid: UUID ... } -- extension LocalNotificationManager: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { guard let userInfo = response.notification.request.content.userInfo["uuid"] as? Data else { print("No data found in notification userInfo") return } } -- struct ItemList: View { @Query var items: [Item] @State private var path = NavigationPath() var body: some View { NavigationStack(path: $path) { ForEach(Array(items.enumerated()), id: \.element.id) { index, item in NavigationLink(value: item) { ItemButton(item: item, index: index) } } } }.navigationDestination(for: Item.self) { item in DetailItem(item: item) } }
Posted
by Flowco.
Last updated
.
Post not yet marked as solved
0 Replies
994 Views
Dear Apple support, We are working on one of the projects related to BLE, in which our BLE device is acting as a GATT client and my iPhone device (iPhone 13, 17.3) is acting as a GATT server. Issue being faced: Whenever my BLE device subscribes to the ANCS notifications, and the moment the IOS device starts bombarding with the notifications available in notification center, the BLE device controller's heap memory becomes UNAVAILABLE in runtime for this notifications' queue and eventually making the BLE controller to reset. Thereafter, whenever user tries making a new connection session of BLE, again same thing repeats. Notifications allowed : W-SMS, W-CALL, SMS, CALL, none other than this. Issue observed with : 150 notifications and above available in notification center, otherwise our product works fine with iPhone. We would like to know how we can curb the number of PRE-EXISTING type notifications available in the notification center flowing towards the BLE device? What best solution can be done at the IOS side, we also have IOS APP team for this project. What kind of APIs does Core Bluetooth framework can provide to the IOS developer in order to overcome this issue. Please suggest possible ways from the IPHONE device only to overcome this. BLE's software CANNOT BE CHANGED under any circumstances as the product is already in production and complaints are coming from end user (from the field). OUR GOAL : ONLY notifications which will be available in run time, i.e. AFTER SUCCESSFUL BLE connection established to be displayed in the BLE's display. We DON'T WANT older notifications to be displayed and flow towards BLE over ANCS. WE MUST make 'notification popup' option as ALLOW to be shared with our BLE device, otherwise SMS,CALL, W-SMS,W-CALL during live connection will not come on the BLE 's display.
Posted
by MM_GGN.
Last updated
.
Post not yet marked as solved
0 Replies
168 Views
Hi, Team. I use old widget(Today Extension) to show some info to users, but when my app had got updated , the widget missed and can't find it in today gallery. I see lot's of apps have same issue, is this a system bug? Thanks you for your reply.
Posted Last updated
.
Post not yet marked as solved
11 Replies
2.3k Views
There's an issue in the iOS 17 beta where passing nil to activityBackgroundTint(_:) does not use the system's default background material as expected. Instead, it's showing a solid black color instead of the correct tint that matches the rest of the system in iOS 16.
Posted Last updated
.
Post not yet marked as solved
1 Replies
355 Views
I have a question about APNs specifications. We are aware that if we delete the app, we will disable the device token managed by APNs. we intend to send a push notification from AWS SNS to APNs and if the device token is disabled, AWS SNS will identify that the app has been deleted from our phone. I believe the specification is that iOS uninstall data is only available after the 8th day. However, it has been a month since the uninstallation and still the APNs are not returning the device token as invalid. Why is the uninstall data not available? If there is a way to do this waiting up, please let me know.
Posted
by Yahiro96.
Last updated
.
Post not yet marked as solved
2 Replies
340 Views
Hi. I would like my App to be notified when the phone rings. No, not CallKit-CallKit is for VoIP and does not cover Cellular connections (as of 2/26/24) but, thanks. To continue.. I understand ages-ago there was a Telephony Kit or Framework but, has been discontinued. Has it been replaced with something else? I would like something that seems very simple:a) when the phone rings my App is notified, b) when it stops ringing (combine all possibilities; sent to voicemail, user cancels, user answers) my App is notified. Yes, I understand UserNotifications can make things run but, as I understand it this feature is for the App to schedule notifications, not receive them? If you know of something in UserNotifications that I can leverage I would appreciate your input. Lacking other possibilities I find myself wondering about Siri integration. Siri is notified about system events and generates notifications based upon these events. Is there some way to place my App downstream from Siri and receive system notifications? Thanks everyone.
Posted Last updated
.
Post marked as solved
1 Replies
262 Views
Hi All I have some customer sound file named as .x-wav / .x-m4a, when specify sound file with extension .x-wav, like content.sound = [UNNotificationSound criticalSoundNamed:@"mysound.x-wav" withAudioVolume: 1.0]; it will play defaultcrititicalsound. if I tried content.sound = [UNNotificationSound criticalSoundNamed:@"mysound.wav" withAudioVolume: 1.0]; then it worked
Posted
by Jeff Lu.
Last updated
.
Post marked as solved
3 Replies
293 Views
I would like the notification to stay. I have inter alia following code, it works well but the notification disappears after 5 seconds (both when app is running or terminated): @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { let nc = UNUserNotificationCenter.current() nc.delegate = self return true } public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { let request = notification.request let identifier = request.identifier let userInfo = notification.request.content.userInfo completionHandler([.banner, .list, .badge, .sound]) }
Posted Last updated
.
Post not yet marked as solved
0 Replies
215 Views
When enabling direct C++ interoperability in Xcode, this simple code below NotificationCenter.default.addObserver(self, selector: #selector(subjectAreaDidChange(_:)), name: .AVCaptureDeviceSubjectAreaDidChange, object: nil) gives me the following error Type 'NSNotification.Name?' has no member 'AVCaptureDeviceSubjectAreaDidChange' But if I switch C++ and Objective-C interoperability to just C / Objective-C then the code compiles without errors. The issue seems to affect NSNotification.Name constants only from AVFoundation framework (although there maybe more). Why do I get this error and how do I fix it?
Posted
by xinatanil.
Last updated
.
Post not yet marked as solved
1 Replies
339 Views
We have noticed that the notification service extension stops working after app update for some users and it only starts working again after rebooting the device. Does anybody else have similar problem and what was the solution?
Posted
by mahdi_qw.
Last updated
.
Post not yet marked as solved
1 Replies
342 Views
An app is hanging randomly on app launch, after looking into it, it appears it's hanging on a call to UNUserNotificationCenter.current() calls. I say this because there's logging and the sometimes the last line logged is prior to a call to UNUserNotificationCenter() I have a hang log (.ips file) rom the iPhone and at the bottom it says this. I presume blockingThreadInfo is talking about the thread being blocked, and it identifies the topBlockingProcess as user notifications. "blockingThreadInfo" : { "topBlockingProcess" : "usernotificationsd", The following is the code, why would this code cause a hang? The problem occurs when there's lots of notifications that have been posted i.e. something like 100. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appBecameActive) name: UIApplicationDidBecomeActiveNotification object:nil]; @objc func appBecameActive() { method1() method2() } @objc func method1() { UNUserNotificationCenter.current().getDeliveredNotifications { notifications in if SettingsManager.isProductionFinalBuild() == false { // Log notification center contents for notification in notifications { let title = notification.request.content.title let targetId = notification.request.content.targetContentIdentifier let threadId = notification.request.content.threadIdentifier let categoryIdentifer = notification.request.content.categoryIdentifier let identifier = notification.request.identifier let info = notification.request.content.userInfo Logger.trace("Previously delivered notification: title: \(title) identifier: \(identifier) threadId: \(threadId) category: \(categoryIdentifer) target id: \(String(describing: targetId)) userInfo: \(info)") } let matchchingNotifications = notifications.filter({ $0.request.identifier == kMdnAccountNotFoundNotificationIdentifier }) UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [kMdnAccountNotFoundNotificationIdentifier]) } } func method2() { UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [Constants.kWhatsNewNotificationIdentifier]) UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [Constants.kWhatsNewNotificationIdentifier]) }
Posted
by mungbeans.
Last updated
.
Post marked as solved
3 Replies
499 Views
Refer to the document: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/handling_notification_responses_from_apns#3394529 Error code 410, 'Unregistered' means: The device token is inactive for the specified topic. But since February 1st, 2024, we did not got 'Unregistered' response any more. Do you know why ?
Posted Last updated
.
Post not yet marked as solved
2 Replies
477 Views
Hello Friends, Could you please help me, whats wrong. We have requirement that, when I receive remote notifications on device, I need to save it in to db (without tapping or opening notification banner), regardless my app is in Foreground or in Background. I receive remote notifications on device & simulator both. And UNUserNotificationCenter delegates are being called if app is in foreground, but didReceiveRemoteNotification is not calling when app is background, not killed. func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { // Save to DB completionHandler(.newData) } I am having Xcode 15.2 & I tried on iOS versions 16.x & 17.x both on Simulator and on real devices. // Added this code in App delegate UNUserNotificationCenter.current().delegate = self UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in if granted { // User granted permission DispatchQueue.main.async { UIApplication.shared.registerForRemoteNotifications() } } else { // User denied permission } }
Posted Last updated
.
Post not yet marked as solved
4 Replies
1.2k Views
We have an app where the notification service extension works well most of the time. However, sometimes we have noticed that the extension completely stops working even when the notification is sent successfully via the APNS server in production. We do not see even the log from the didReceive() function in that case. The only way we can get the extension working again is after restarting the iPhone. Trying to understand when this might happen? Is it something that is throttled by iOS? Would it happen when the device memory is low or the app is using too much memory? We have seen the extension crash sometimes due to hitting memory limits, however, the extension process is spawned again when a new notification comes in. Any kind of help or guidance would be greatly appreciated. Thanks We have setup acknowledgment API calls in the notification service extension processing to be notified when the notifications reach the device. So based on that we know how often the devices stop responding with the ACK to sent notifications. It happens seldom with some users and we have to ask them to restart their device to get the extension functional again.
Posted Last updated
.
Post not yet marked as solved
0 Replies
361 Views
Hi, Please take a response to me about my Notification Service Entitlement Request. I have requested 5 times but i didn't get any repsonses. The application cannot be released because authorization is not granted. Please check my case and leave a response as soon as. Thanks,
Posted Last updated
.
Post not yet marked as solved
0 Replies
319 Views
Hello all, I'm trying to build a watch app for a research study built around heart rate. Currently I have built a IOS app with a companion watchOS app for a firebaseDatabase connection. There are two remaining goals of this project that include the following: While the watch app is in the background or when it's closed, is it possible for the apple watch to send a notification to the user if per say the user's heart rate goes over a custom threshold of 70bpm? If so, how should this be implemented, and can the app be consistently monitoring the heart rate to get accurate realtime notifications, or is does apple limit background updates to periodically? For this study, we want to analyze if user's actually open the watchapp because of the notifications. Is it possible to record data / track user interactions from the notifications? If so, what kind of data can be tracked and how can it be stored?
Posted
by bduong21.
Last updated
.
Post not yet marked as solved
0 Replies
282 Views
My application requires me to clear all the notifications from the notification centre after a certain time duration. I have tried using a combination of removeAllDeliveredNotifications & removeAllPendingNotificationRequests and they work fine up until OS 17. So then I tried using removeDeliveredNotificationsWithIdentifiers & removePendingNotificationRequestsWithIdentifiers to check if it works consistently for all OS, but they hasn't worked either. Is there any other way to clear the notifications consistently for all OS?
Posted
by jithinb1.
Last updated
.