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

157 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to dismiss live activity notification from Watch?
If you update live activity with alertConfiguration: argument, iPhone shows a notification (or expands dynamic island): await runningActivity.update(content, alertConfiguration: .init(title: "Alert", body: "Done!", sound: .default)) Paired Watch presents a notification as well: I cannot find a way to dismiss that live activity notification from Watch. Is there a way to remove it similarly to UNUserNotifications? UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [notificationID])
0
0
699
Jul ’23
ITMS-90078: Missing Push Notification Entitlement
Hi, Our project utilizes push notifications via OneSignal SDK. Everything looks correct and conforms with the documentation: The Push Notifications capability is enabled in XCode. The entitlements do contain the "aps-environment" key with the "production" value. I unpacked the resulting IPA and explored embedded.mobileprovision file - it does contain the "aps-environment" key with the "production" value in the Entitlements section too. The App ID and provision profiles used do include the Push Notification capability. So there's literally nothing to fix. Despite of that, when uploading the IPA to AppStore Connect, we receive an email with the warning "ITMS-90078: Missing Push Notification Entitlement..." that says there's no "aps-environment" entry. Moreover, the OneSignal dashboard indicates "Missing Push Capabilities" for all the iOS devices that run our application. Consequently, the push messages are not received. What could be wrong with the IPA and where to look at? Thanks in advance!
2
0
1.3k
Jul ’23
Delay when posting Local notification on Apple Watch
Hi! I have some trouble with local notification delivery on Apple Watch. It can take more than 1 minute to see the first local notification delivered. I made sure to not use a trigger so the notification will be delivered right away possible as specified in the UNNotificationRequest initializer doc. But there is always a delay for notification delivery. Here is how I'm creating the local notification: content.title = "title" content.subtitle = "subtitle" content.body = "body" content.userInfo = "userInfo" content.categoryIdentifier = "categoryIdentifier" content.threadIdentifier = "threadIdentifier" content.sound = UNNotificationSound.default let notifyRequest = UNNotificationRequest(identifier: stringWithUUID(), content: content, trigger: nil) let center = UNUserNotificationCenter.current() center.add(notifyRequest) { ( error: Error?) in if let theError = error { print(theError.localizedDescription) } else { print("Scheduled OK") } } Do you have any idea how to avoid the delay? Best!
0
0
505
Jul ’23
Silent Notification
I am trying to implement silent push notification in my application where I need to update some data in the server when silent notification comes. I am using Pushkit and it uses VoIP certificate for silent push notification but the app has been rejectd by Apple saying that "I can't use VoIP" certificate. It seems that apple has rejected it as I don't have any VoIP call functionality in my app. In that case how can I implement silent push notification so that my app gets activated even if it is not runnning(not even in the background) and I can update the server?
4
0
4k
Jul ’23
When does a notification service extension process get terminated?
If there is the following code for a notification service extension var countOfInvocations = 0 public class NotificationService: UNNotificationServiceExtension { public override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { NSLog("Push count: \(countOfInvocations)") countOfInvocations = countOfInvocations + 1 Then if pushes are sent to the handset it can be observed in the console log that the value of countOfInvocations keeps increasing, meaning the NotificationService class is getting instantiated and destroyed within the same process. However at what point does that process get torn down by the OS? It seems to be kept alive for about 10 minutes or so. Is there a way the extension can detect its the same or a new process?
1
0
413
Jul ’23
How to determine when iOS app notification service extension process is about to be terminated?
class NotificationService: UNNotificationServiceExtension { override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) { // call content handler here when ready } override func serviceExtensionTimeWillExpire() { // call content handler here with the best attempt } } As I understand, for each notification a new instance of NotificationService is created, but all these instances can be in the same process that may share access to the database, network connections and other resources - iOS doesn't start a new NSE process for each new notification, and connecting/disconnecting to/from these resources for each notification would be very inefficient. At some point iOS kills NSE process, and in some cases it results in the exception with 0xdead10cc exit code ("dead lock") that is visible to the users as an alert about the crash of the app in the background. Is there a way to determine when iOS is about to kill NSE process to release the resources?
0
0
385
Jul ’23
About "ITMS-90078: Missing Push Notification Entitlement" that comes when using Firebase Unity SDK
Questions When I installed the Firebase DynamicLinks Unity SDK and uploaded it to TestFlight, I have received an email from AppleStoreConnect stating "ITMS-90078: Missing Push Notification Entitlement". Q1. is there any chance that leaving this situation unresolved will lead to rejection or suspension of distribution at the time of AppStore release? Q2. if anyone knows of a solution to this problem, please let me know. Background We are developing with Unity, a game development engine, outputting an Xcode project, and uploading it to TestFlight from Xcode. We have enabled Push Notification in the Capabilities setting of AppID, but we do not use this feature in our app, and we do not use a certificate for Push Notification. The same AppID setting did not send the same email until now, but when the Unity SDK for Firebase Dynamic Links was installed, the above email started to arrive. We believe that it is difficult to solve the problem at present, because there is a report on the Github issue of the SDK provider that the same email is received even if the Capabilities of Push Notification is turned off. (https://github.com/firebase/firebase-unity-sdk/issues/375) Thank you.
0
0
824
Jul ’23
PWA push notifications on iOS
Hi all, I have a PWA with notification system working well on any other device including MacBook. But my customers start to complain that they don't receive any notification on their iphone. I checked with a friend iPhone XR with iOS 16.5.1 installed on it. And it seems that web push notifications are still deactivated in the experimental features. Is it normal? Did I mis something? Apple said they delivered webpush API on iOS16 but it's deactivated by default. I can not ask my customers to go there to activate the option is it a solution to override this or do we still need to wait 10 years to get it activated? Thanks in advance
3
1
5.9k
Jul ’23
Push payload is not present on notification tap
I am checking if the user taps on the firebase push notification and get the payload. override func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { let userInfo = response.notification.request.content.userInfo os_log("notification tapped %{public}@", log: OSLog.push, type: .info, userInfo) handleNotificationPayload(userInfo as! [String: AnyObject]) setFlutterLinkClickedVariable() } My use case is in app terminated state when push notification is tapped, get the link from payload and navigate to corresponding screen based on the link. This is working when there is only one push notification. When there are multiple push notifications with different links in the payload, only the first notification I tap works. Rest of the notifications just launches the app and does not navigate because the link is not set. I am getting the link from the payload and invoking flutter code which sets the link in the user defaults (shared preferences) and when the app launches in the home screen it checks for this variable and navigates accordingly. func handleNotificationPayload(_ payload: [String: AnyObject]) { if let link = payload["link"] as? String { setFlutterLinkVariable(link) } } override func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { os_log("app did receive remote notification %{public}@", log: OSLog.push, type: .info, userInfo) handleNotificationPayload(userInfo as! [String : AnyObject]) completionHandler(.newData) } Currently when there is only one push notification it works because the link is set from the above method. The click delegate is not calling. I did set the delegate in application(:didFinishLaunchingWithOptions). UNUserNotificationCenter.current().delegate = self application.registerForRemoteNotifications() How to solve this issue? Thanks.
1
0
451
Jul ’23
Issue with VoIP Push Not Received in Certain Conditions - Seeking Cause and Countermeasures
Dear Apple Developer Forum members, We recently encountered a situation where VoIP Push notifications were not being received under specific conditions. We would greatly appreciate any insights or information regarding the potential cause of this issue and possible countermeasures. Incident Details: Problem: VoIP Push notifications are not being received. Device Information: iPad Air (9th generation) OS version: 16.1 Prerequisites for the Issue to Occur: Device is operating without a SIM card, using only Wi-Fi connectivity. Auto-lock feature in Settings is disabled. Low-security Wi-Fi network is being used (specifically, a pocket Wi-Fi device with a low-security label). Procedure to Reproduce the Issue: Leave the app running in the foreground without any user interaction for approximately 5-6 minutes. Send a VoIP Push notification to the target device. No notification appears on the device. Investigation Details and Findings: No apsd (Apple Push Notification Service daemon) log output was generated at the time the VoIP Push notification was sent. We suspect the apsd process may have been stopped for some reason. Is it possible that the apsd process, configured as a wake-on-WAN client, fails to start when the packet is received? Additional information from the macOS Console: Following the log output below, notifications stopped being received: Default 18:26:12.416462+0900 apsd <private> _disconnectStream for interface: WWAN with reason: 2 Default 18:26:12.416574+0900 apsd <private>: Setting is connected 0 on interface WWAN with reason 2 Default 18:26:12.416681+0900 apsd Connection closed development WWAN Default 18:26:12.416783+0900 apsd <private> canUseProxy: NO isNearby: NO Default 18:26:12.416886+0900 apsd <private> received courierConnectionStatusDidChange from <private>. Default 18:26:12.416986+0900 apsd <private> canUseProxy: NO isNearby: NO Default 18:26:12.417090+0900 apsd <private> canUseProxy: NO isNearby: NO Default 18:26:12.417193+0900 apsd <private> updating network guidance isConnected? YES Default 18:26:12.417296+0900 apsd <private> canUseProxy: NO isNearby: NO Default 18:26:12.417396+0900 apsd <private> canUseProxy: NO isNearby: NO Default 18:26:12.417506+0900 apsd Attempting to roll activity presence salt Default 18:26:12.417606+0900 apsd It has not been long enough since the last roll Additional information from the Wi-Fi daemon (wifid) log: The following entry was found: "wifid apsd[122] is a wow client." Additionally, we noticed the following recurring log entry: ERROR: __WiFiLQAMgrIsIntervalChangeAllowed: Too frequent LQM interval change not allowed. Thank you in advance for any assistance, suggestions, or information you can provide. We are eager to understand the cause of this problem and explore potential remedies. Best regards,
0
0
780
Jul ’23
CloudKit Console: JSON Web Token Validator shows Unrecognizable claims found (Token Generated with Python)
Hello guys I am getting this error Unrecognizable claims found when trying to validate my JWT Token for push notifications. I don't understand what it means. Can someone tell me how to resolve this issue? I am using python, and using the time module to generate the epoch. I guess, this is where the issue is coming from, but I am not sure. import time epoch = time.time() Thanks in advance.
1
1
812
Jul ’23
Issue with Safari PWA and Push Notifications: clients.openWindow Not Functioning
Hello everyone, I've been working on implementing push notifications for the web PWA using JavaScript, and I've encountered an issue specifically with Safari on Mac and iOS devices. While my code snippet works perfectly fine in Chrome, I'm facing a problem with the clients.openWindow function. It doesn't seem to perform any actions or provide any errors. Here's the code snippet for reference: self.addEventListener('push', (event) => { const notification = JSON.parse(event.data.text()); console.log(notification); const title = notification?.notification?.title; const body = notification?.notification?.body; const data = notification?.data; const options = { body, data, icon: '/favicon.ico', badge: '/favicon.ico', vibrate: [100, 50, 100], actions: [ { action: onNotificationAction(notification['data']), title: notification.notification.title, }, ], }; event.waitUntil(self.registration.showNotification(title, options)); }); self.addEventListener('notificationclick', (event) => { console.log(event, 'event'); const notification = event?.notification; event.notification.close(); event.waitUntil( clients .matchAll({ type: 'window', }) .then((clientList) => { for (const client of clientList) { if (client.url === '/' && 'focus' in client) return client.focus(); } if (clients.openWindow) return clients.openWindow('/messages'); }), ); }); After thorough testing, I've determined that the issue lies specifically with the clients.openWindow function. Unfortunately, I haven't been able to identify any errors or determine why it isn't functioning as expected. The goal is to open a new window or focus on an existing one when a notification is clicked. I would greatly appreciate any assistance or insights into resolving this issue. Has anyone else encountered a similar problem with Safari and iOS? Are there any alternative approaches or workarounds that could achieve the desired functionality? Thank you in advance for your help and suggestions!
0
2
895
Jul ’23
APNS notifications are not received in device, but server gets success (200) when send to APNS
In my application, I'm using both APNS for push notifications. In my app, both tokens are generated properly and updated on my App's server. When sending an APNS push from my server, the push is successfully reached the APNS server, but can't deliver to the device, even though we are getting success from APNS Server. we are getting 200 from APNS. but the same thing If I am trying to use the "Push Hero" 3rd Party app, and I am getting notifications in the app also, with no any issue. but can't get it from my server. I am using a .p8 file for push notifications in both the server and 3rd party apps.
0
0
643
Jul ’23