Notification Center

RSS for tag

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

Posts under Notification Center tag

59 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Push Notification Gets Removed From Notification Screen When Setting "badge" to 0
Push message on the lock-screen disappears in one specific instance. In general the situation is as follows: the application, upon starting up, sets the badge counter (i.e. notificationCenter.setBadgeCount(3)) the application is being sent to background the screen is locked (it doesn't matter if it's turned on or not) send a push message to the application and set the badge (in aps) to "0" What happens: the screen lights up (unless it's lit up already), the push is being displayed for a very short time and gets hidden. Happens on iOS 18.1, 18.1.1, 18.2. If not setting badge in the aps keys it works correctly. I've created a feedback report https://feedbackassistant.apple.com/feedback/16095572. I am able to reproduce the issue on a sample app 100% of the time :/
2
0
159
2w
iOS 18.2 Heavy Delays in Notifications with AI enabled
I am experiencing heavy delays with any push notification if I have AI enabled. Authenticator takes minutes to show up, the app for the doorbell that, needless to say, requires a real-time notification, fails to deliver push notifications in time. I have had to turn off AI in order to have a functioning phone... (I'm on a 16 Pro) Any resolution on this? Thanks
2
0
294
2w
Does Firebase Push Notification Service Need New Certificates Due to APNs Update
Hi, With the upcoming changes to the Apple Push Notification service (APNs) server certificates — including the SHA-2 Root: USERTrust RSA Certification Authority certificate update — I wanted to clarify if we need to take any action with Firebase Cloud Messaging (FCM). Since we’re using FCM to send push notifications to iOS devices, does Firebase also need to update its server certificates in response to these changes, or will Firebase handle the updates automatically? We understand that Apple recommends updating our Trust Store to include the new certificates for APNs, but we’re unsure if any action is needed on our end for FCM specifically. Thanks in advance for the clarification!
1
2
2.4k
3w
Notifications on iOS sourced from a machine on an offline local network
We have a device which is an appliance and we are developing a control interface app for macOS and iOS/iPadOS. How can we set up our iOS application to grab information from a local network device while it is in the background in order to show notifications? Communication between the Apple device and our device is via local networking and the device is designed to be used on networks without internet connections. On networks with internet connections we could forward events from the device, via a server and APNS push notifications, but that isn't valid here. Events occur on our device and are forwarded to clients, who are subscribed to Server-Sent Events. On macOS this works well and the application can receive updates and show Notification Center notifications fine. On iOS we are using a BGAppRefreshTaskRequest with time interval set to 1 minute, but it appears that we get scheduled only every few hours. This isn't very useful as notifications just arrive in batches rather than in a timely manner. All normal networking is closed when the app goes into the background, so we cannot keep the SSE request open. Another idea which we haven't tried yet: Creating a new endpoint on the device which keeps the connection open until a notification arrives, then using background URLSession to poll on that endpoint. Would that work? It seems like a mis-use of the API perhaps?
9
0
259
2w
Regression: iOS 18.2 heavy delay of local push notifications (even time sensitive notifications)
Hello! I am working on an app that requires to send a local push notification to the user from an app extension (from the ShieldActionDelegate to be precise). This is suggested by DTS as a workaround for this issue: https://forums.developer.apple.com/forums/thread/766644 But now, on the iOS 18.2 beta, local push notifications are delayed by up to 10 seconds, even though the push notification is classified as .timeSensitive, leading to a very bad user experience (where to user has to sit and wait for the notification to arrive without knowing how long it will take). This only happens when Apple Intelligence is turned on. This had happened previously on the iOS 18.1 beta but was fixed for the final release: https://forums.developer.apple.com/forums/thread/764848 But now the issue came back on the latest iOS 18.2 beta. I have documented the new behavior in FB15668616 Any help is appreciated!
3
3
1.2k
Nov ’24
Actionable notifications on watchOS don't get iOS variables
I am developing an app which makes use of actionable notifications. On my code (the func userNotificationCenter function), I need to read my users from the local storage on the iPhone: let query: [String: Any] = [ kSecAttrService as String: "uio-auth", kSecAttrAccount as String: "users", kSecClass as String: kSecClassGenericPassword, kSecReturnData as String: true ] var result: AnyObject? SecItemCopyMatching(query as CFDictionary, &result) let ref = result as? Data But when the same code execute when I tap on the notification on the Apple Watch, it doesn't fetch anything. It now occurs to to me: Does it mean that when an actionable notification programmed for the iOS is displayed on the Apple Watch, it tries to access its own storage, and not the iPhone? If so, is there a nice way to pass the values to the watchOS so that when the callback for the actionable notifications run, it has then the data it needs?
0
0
239
Oct ’24
Hourly repeating notification.
Somebody help me please. I try to set specific time for notification, it works nice, but if you need a little beat more functional this is where difficulties appear. I'd like to give opportunities for repeat, example every hour. I know that UNCalendarNotificationTriger has a repeat value, but when you set repeat on true it remember date component, exp - .minute, and then just repeating notification every time when that minute comes! I'm looking for solution for set notification at special time(exp: 5:00 pm), and then repeating this notification every hour(6, 7, 8, 9 pm) Maybe it's so easy but looks like I feel stuck 😕
2
0
269
Oct ’24
Custom notification images are confused with those from other apps.
My app uses custom notifications with custom images. Why do these images get mixed up with those from other apps, causing my notifications to display images from other apps? `INImage *avatarImage = [INImage imageWithImageData:imageData]; NSPersonNameComponents *nameComponents = [[NSPersonNameComponents alloc] init]; nameComponents.nickname = content.title; INPersonHandle *handle = [[INPersonHandle alloc] initWithValue:nil type:INPersonHandleTypeUnknown]; INPerson *messageSender = [[INPerson alloc] initWithPersonHandle:handle nameComponents:nameComponents displayName:content.title image:avatarImage contactIdentifier:nil customIdentifier:customIdentifier isMe:NO suggestionType:(INPersonSuggestionTypeNone)]; INSpeakableString *speakableString = [[INSpeakableString alloc] initWithSpokenPhrase:content.subtitle.length ? content.subtitle : @""]; INSendMessageIntent *intent = [[INSendMessageIntent alloc] initWithRecipients:@[messageSender] outgoingMessageType:(INOutgoingMessageTypeOutgoingMessageText) content:content.body speakableGroupName:speakableString conversationIdentifier:identifier serviceName:nil sender:messageSender attachments:nil]; [intent setImage:avatarImage forParameterNamed:@"speakableGroupName"]; INInteraction *interaction = [[INInteraction alloc]initWithIntent:intent response:nil]; interaction.direction = INInteractionDirectionIncoming; [interaction donateInteractionWithCompletion:nil]; UNNotificationContent *_content = [content contentByUpdatingWithProvider:intent error:nil]; UNNotificationRequest *request = [UNNotificationRequest requestWithIdentifier:identifier content:_content trigger:trigger]; [UNUserNotificationCenter.currentNotificationCenter addNotificationRequest:request withCompletionHandler:completionHandler];`
2
1
320
Oct ’24
Local notification shown in iphone not shown on apple watch
I created a local notification as follows: func scheduleNotification(title: String, subtitle: String = "", date: Date, id: String) { // Extract the components from the date let calendar = Calendar.current let hour = calendar.component(.hour, from: date) let minute = calendar.component(.minute, from: date) let second = calendar.component(.second, from: date) // Set the extracted components into DateComponents var dateComponents = DateComponents() dateComponents.hour = hour dateComponents.minute = minute dateComponents.second = second let content = UNMutableNotificationContent() content.title = title content.subtitle = subtitle content.sound = UNNotificationSound.default let action1 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.label, options: []) let action2 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.label, options: []) let category = UNNotificationCategory(identifier: "reminderCategory", actions: [action1, action2], intentIdentifiers: [], options: []) UNUserNotificationCenter.current().setNotificationCategories([category]) content.categoryIdentifier = "reminderCategory" let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) let request = UNNotificationRequest(identifier: id, content: content, trigger: trigger) // add our notification request UNUserNotificationCenter.current().add(request) } and I also have func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { // Handle foreground presentation options completionHandler([.sound, .badge]) } but for some reason the notification only shown on the phone. I've made sure that the phone is locked, apple watch is unlocked and also the notification setting in the watch app for this app is set to mirror.
0
0
259
Oct ’24
Request authorization for the notification center crash iOS app on Swift 6
Hey all! During the migration of a production app to swift 6, I've encountered a problem: when hitting the UNUserNotificationCenter.current().requestAuthorization the app crashes. If I switch back to Language Version 5 the app works as expected. The offending code is defined here class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure() FirebaseConfiguration.shared.setLoggerLevel(.min) UNUserNotificationCenter.current().delegate = self let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound] UNUserNotificationCenter.current().requestAuthorization(options: authOptions) { _, _ in } application.registerForRemoteNotifications() Messaging.messaging().delegate = self return true } } The error is depicted here: I have no idea how to fix this. Any help will be really appreciated thanks in advance
13
2
1.8k
Nov ’24
Post Notification to RCP but Timeline won't fire
I am trying to use onNofitication in BehaviorComponent to fire up my composed timeline actions. Which is formed up by one TransformTo action, one Hide action and followed by a Notification action indicating the other two actions are finished. With this post, I successfully send a notification to RCP to fire up my timeline with identification: NotificationCenter.default.post( name: NSNotification.Name("RealityKit.NotificationTrigger"), object: nil, userInfo: [ "RealityKit.NotificationTrigger.Scene": scene, "RealityKit.NotificationTrigger.Identifier": "onSomethingStart" ] ) On the other hand, to subscribe that Notification Action, I append a onReceive function below my RealityView, and succesfully received my notification private let notificationTrigger = NotificationCenter.default.publisher( for: Notification.Name("RealityKit.NotificationTrigger")) guard let entity = out.userInfo?["RealityKit.NotificationTrigger.SourceEntity"] as? Entity, let notificationName = out.userInfo?["RealityKit.NotificationTrigger.Identifier"] as? String else { return } debugPrint("Received notification: \(notificationName), entity name: \(entity.name)") Which means that my Timeline is fired up because I can received my notification in my Timeline. But the rest two actions just don't appear to be working. I played the timeline in RCP it works fine. Anything I missed to make it tick? XCode beta 16.1 VisionOS beta 9
2
0
515
Sep ’24
The notification is invalid
I can execute an action by allowing Xcode to send a notification to Reality Composer Pro via NotificationCenter, or I can send notifications to Xcode through the Notification Action in Reality Composer Pro. However, I discovered that they were unable to accept notifications from both parties within my project. To ascertain whether there was an error in my code, I created a simple Demo project. I utilized the same code and determined that it functioned normally within the Demo project. It is perplexing that I am unable to resolve this issue. Do I require additional modifications?
1
0
464
Aug ’24
Can TodayExtensions and WidgetKit Coexist in an App
I understand that TodayExtension will be deprecated in iOS 18, and we have integrated WidgetKit into our app. However, we have encountered some issues during the app update process. Specifically, we noticed that the TodayExtension might not appear in the tools list or sometimes the TodayExtension appear "Unable to Load" Could you please advise on the possible causes of this issue? Is there a way to resolve it if we want to keep both types of widgets active?
3
0
826
Aug ’24
Rich-push notifications
For notifications, I am using a firebase api [cloud messaging ]. I am getting normal notifications in all app states. when I try notifications with the attached image URL, in the foreground the image is displayed and it working properly but when the application is in a background state or terminated the normal text notification is getting without image. I also tried using the ns-notifications service and contents.
1
0
327
Aug ’24
Opening parent app from Widget upon Push Notification
Good afternoon! I am working on an app which requires the app to be opened in response to a push notification from a background state. As it stands: The app is running in the background The app has a static widget on the homepage The app has a dynamic widget with a live activity which is being updated from the backend The dynamic widget is firing an event which the static widget is listening for The static widget is programatically calling an AppIntent which tries to open the parent app Is this possible? Is there a better approach which would work? We are looking for a way to open the app from the background with the users permission. Appreciate any guidance on the issue
0
0
345
Aug ’24
LiveActivity not starting - error: target does not include NSSupportsLiveActivities plist key
I'm trying to start a live activity that allows a user to see and control a recording from their lock screen. I have an AppIntent that uses a class to start recording the user. The intent is used in a home screen widget. Upon pressing the button in the widget, the intent is called, which then calls the startRecording function within its perform. This function then tries to start the live activity, but it is currently failing with a "Failed to start live activity: The operation couldn’t be completed. Target does not include NSSupportsLiveActivities plist key" error. The relevant code block is this: func startRecording() { print("[RecordingManager] start recording called") isRecording = true let activityAttributes = RecordingControlWidgetAttributes(name: "RecordingManagerActivity") let initialContentState = RecordingControlWidgetAttributes.ContentState(isRecording: true, startTime: Date()) let initialContent = ActivityContent(state: initialContentState, staleDate: nil) if ActivityAuthorizationInfo().areActivitiesEnabled { do { liveActivity = try Activity<RecordingControlWidgetAttributes>.request( attributes: activityAttributes, content: initialContent, pushType: nil ) } catch { print("Failed to start live activity: \(error.localizedDescription)") } } else { print("Live activities are not available") } // TODO: actually start the recording } When this function is run/the button is pressed, the following messages are printed: "[RecordingManager] start recording called Failed to start live activity: The operation couldn’t be completed. Target does not include NSSupportsLiveActivities plist key" However, I have included the NSSupportsLiveActivities key, with value YES, in the target Info in XCode for both the main app target and the WidgetExtension. The following line exists in both the Release and Debug parts of the project.pbxproj file: INFOPLIST_KEY_NSSupportsLiveActivities = YES; I also tried including this key and value directly in the Info.plist file of both targets, but that also didn't work. This issue is occurring both on device and in simulator. I also checked that both my device and the simulator has LiveActivities turned on in Settings for the app. What could be going wrong? Are there any other situations where this error may print?
0
1
594
Jul ’24