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.

User Notifications Documentation

Posts under User Notifications tag

225 Posts
Sort by:
Post marked as solved
6 Replies
374 Views
Right after I receive a notification I want to execute a background task. I'm using firebase to receive notification. I can receive notification successfully with 'UNUserNotificationCenter' in the AppDelegate file. Now my goal is to send a "GET" - "PUT" request, right after I received a notification (only when the app is in background) I saw the documentation about Background Tasks: https://developer.apple.com/documentation/backgroundtasks But I can't found a way to execute a background task right after I receive a notification. Is anyone has any suggestion about that? Thank you
Posted Last updated
.
Post not yet marked as solved
0 Replies
137 Views
When creating a new Multiplatform project on Xcode 14 beta and adding a Notification Service Extension Target, compilation fails with: error build: Your target is built for macOS but contains embedded content built for the iOS platform (Notification.appex), which is not allowed. This really limits the usefulness of the new multiplatform single target, especially if we cannot incorporate basic extensions. Is there any way to use single target multiplatform and still have the freedom to add necessary extensions to the app?
Posted
by smueller.
Last updated
.
Post not yet marked as solved
1 Replies
158 Views
We use remote push notification with content available = 1, as per document it will wake up app, but it doesn't work properly, sometimes the app doesn't wake up. I have observed this behaviour mostly on iOS 15. We use this mechanism to send device location to our server. Why remote push notification doesn't wake up my app all the time ?
Posted
by avartak.
Last updated
.
Post not yet marked as solved
1 Replies
476 Views
I have implemented push notification and subscribe app on different news topics. When a silent push notification received i want my app to subscribe/unsubscribe the topic on type based. But problem i am facing is when app is in background code executed and hit the subscribe/unsubscribe code but app wont process it and as soon as i open the app i got message that topic has been subscribed/unsubscribe successfully. While in foreground code is executing and processing successfully. Background processing and Background fetch are enabled in background modes. My Code is as: func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { if let messageID = userInfo[gcmMessageIDKey] { print("/// Message ID: \(messageID)") } if let topic = userInfo["topic"] as? String{ if let type = userInfo["type"] as? String{ do { if(type == "unsubscribe"){ Messaging.messaging().unsubscribe(fromTopic: topic) } else { Messaging.messaging().subscribe(toTopic: topic) } }catch{ } } } // Print full message. print("info = ", userInfo) Messaging.messaging().appDidReceiveMessage(userInfo) completionHandler(UIBackgroundFetchResult.newData) } My Headers from postman are apns-push-type:background apns-priority:10 and the body { "to" : "*** device token ***", "priority" : "high", "content_available": true, "data" : { "topic" : "Sports", "type" : "unsubscribe" // subscribe } } What i want is to subscribe/unsubscribe the fcm topics when app is in background and silent notification received.
Posted
by u_ali.
Last updated
.
Post not yet marked as solved
1 Replies
284 Views
I have this error: [AXRuntimeCommon] AX Lookup problem - errorCode:1100 error:Permission denied portName:'com.apple.iphone.axserver' PID:963 It is preceded by lots of this message, if it matters: [Assert] +[UIInputViewSetPlacementInvisible placementWithPlacement:]: Should not be called with an invisible placement I thought it was because I didn't include a key in Info.plist, but I put keys in there that I thought might be needed. I am using CloudKit sharing and silent push notifications for CloudKit subscriptions, and the Apple documentation says when I set the capabilities for background fetch and remote notifications, the keys would be put in Info.plist by Xcode. Does this have anything to do with the fact that when my app is run for the first time it asks the user for permission to send notifications. If it's a silent notification that I'm using, I thought the documentation meant the user is not notified at all? I have searched on the internet and on stack overflow and in Apple developer forums for a solution. Any help will be appreciated.
Posted Last updated
.
Post not yet marked as solved
24 Replies
22k Views
HiWe are receiving myriad complaints from members that our app is now missing from Settings -> Notifications, and so our members cannot receive push notifications any longer.Previously we thought that this was related to users denying us notification permissions during first run, but we are now seeing this reported from long-time users who recently auto-upgraded.We are telling them to delete and reinstall and that (generally) fixes the issue. However, we would like this issue never to happen -- what is causing this, and/or what work-arounds can we implement to ensure we continue to appear in the notifications center?Thanks,Eric
Posted Last updated
.
Post not yet marked as solved
0 Replies
130 Views
Hi, I've recently faced with an issue while dealing with PushKit and CallKit. Everything was working fine before adding a socket connection method to my code. I want to be connected to the socket before calling reportNewIncomingCall so I adjusted my code accordingly. Then I realized that completion block of reportNewIncomingCall is not being called. I don't understand why, any thoughts? The part of didReceiveIncomingPushWith delegate method, mentioned above: func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) { . . .             Log.addedCallInfotoAppDelegate.add("callID: \(String(describing: callID!)) callerName: \(callerName) uuID: \(String(describing: self.uuID!))")   let semaphore = DispatchSemaphore(value: 0)                 self.connectSocket { success in                     if success {                         Log.socketSuccessfullyConnected.add()                     } else {                         Log.errorWhileConnectingSocket.add()                     }                     self.update.remoteHandle = CXHandle(type: .phoneNumber, value: callerName)                     self.update.hasVideo = false                     self.update.localizedCallerName = callerName                     self.update.supportsGrouping = false                     self.update.supportsUngrouping = false                     self.update.supportsHolding = false                     self.provider.reportNewIncomingCall(with: self.uuID!, update: self.update) { error in                         Log.doneReporting.add()                         if error == nil {                             Log.didReportIncomingCall.add()                             if !stateCheck {                                 self.provider.reportCall(with: self.uuID!, endedAt: Date(), reason: .answeredElsewhere)                                 Log.reportedEndedCall.add()                                 self.uuID = nil                                 self.callID = nil                                 Log.deletedCallInfoFromAppDelegate.add()                             }                             semaphore.signal()                         } else {                             Log.errorWhileReportingIncomingCall.add(String(describing: error))                             semaphore.signal()                         }                     }         } else {             semaphore.signal()         }         semaphore.wait()         completion() }
Posted Last updated
.
Post not yet marked as solved
0 Replies
162 Views
We are trying to suppress or show the notification received based on device. We have a business requirement that once the notification receives on the device, based on device location and predefined geo-fence location, we want to either show or suppress it. we have submitted the similar request to apple entitlement and the request got rejected by apple saying "This is not a supported usecase of the Notification Service Extension filtering entitlement." Can you please help why is this rejected and what are the usecases we can make use of this "com.apple.developer.usernotifications.filtering" request get approved by apple.
Posted Last updated
.
Post not yet marked as solved
3 Replies
632 Views
Hello All. iOS15 can't play sound sound only Local Notification. Before iOS15 I can use following code.title, body and subtitle is @"" (No charactor). UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init]; content.title = @""; content.body = @""; content.subtitle = @""; content.sound = [UNNotificationSound soundNamed:@"test"]; When iOS15, I need add content.title for play sound. I don't want display Notification on banner and notification center also Lock Screen. I want use Sound only Local Notification. Is it a specification of iOS15 or BUGS?
Posted Last updated
.
Post not yet marked as solved
1 Replies
477 Views
Hello everyone, every time i send a new version off my app i receiving an email with this warning. I'm using CODEMAGIC to build the versions because don't have macbook. ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the 'aps-environment' entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the 'aps-environment' entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1. I'm realy want to use this service. I just mark the checkbox in "App ID Configuration". Just have created a APN key and send to firebase. I send message to apple, they say to search in forum, but there is no solution there. PS: I can't generate a certificate to put on the Push Notification because using codemagic and the VM changes every time i build a new version.
Posted Last updated
.
Post not yet marked as solved
0 Replies
111 Views
Can we implement background activities for longer period of time after a silent push notification is sent?
Posted
by AyushiP.
Last updated
.
Post not yet marked as solved
2 Replies
296 Views
We're developing an application which involves Packet Tunnel Provider extension. Inside the extension we connect to remote server to get tunnel config profile and authentication parameters, followed by tunnel creation. If we are not able to establish the tunnel, we would like to notify the user via the containing app. It is possible the tunnel extension is running when the containing app is not running, so we decided to send a notification (via UserNotifications) to achieve the same. Requirement is that: If containing app is in foreground, notification should not be displayed, app handles whatever is required If app is in foreground, when user clicks on the notification, app should come into foreground and handle it If app is not running, app should launch and handle the notifications If user launchers app/app comes into foreground, app handles all shown notifications and clears them We are trying to achieve this by implementing the UNUserNotificationCenterDelegate in AppDelegate of containing app. Now all above requirements are fulfilled when the notification is published by the containing app, but when published by the NEPacketTunnelProvider extension, the notification appears but clicking on it does not call the appropriate delegate function in containing app. We want to support MacOS 10.15 and above if possible. We are testing on MacOS 12.4 and 12.3.2 for now. Please help with same or suggest a better way of notifying the user that some action is required and containing app needs to be opened.
Posted Last updated
.
Post not yet marked as solved
0 Replies
134 Views
Silent Push Notification is not received to the device. I am sending push notifications from the https://fcm.googleapis.com/fcm/send Request Payload: { "content_available": true, "apns_priority": 10, "data": { "title": "Title of the notification", "body": "This string has message", "deviceId": "f565fa30-b5b2-11ec-bb6c-79ad60e4f707" }, "registration_ids":[ "List of registered devices"] } Now when I send the notification. I am getting the notification randomly on the devices. I was sending notification to 5 devices. Now 3 devices were receiving the notification and 2 device didn't received. When the app is running in the foreground I am getting notification in all devices. When app is in background I am getting notifications. When app is killed by the user and even phone is locked I didn't receive any notification in couple of devices and received in other device. Now, when I open the app I immediately received the notification. I read an article from apple doc on silent push notification and there it is clearly mentioned that there is no guarantee of notification delivery to the device. I cannot use normal notifications because I am filtering data before the notification. If payload have device id which is equal to stored device id then I fired a local notification if not then notification is silent. Any solution for this issue?
Posted Last updated
.
Post not yet marked as solved
2 Replies
185 Views
I need to get a log or information on when the user has turned off their notifications on Screen Sharing when ReplayKit is used to record a users screen. User's are not getting push notifications when they are screen sharing in the app. I want to allow users to get push notifications or at least notify to the api when ever a user turns off their push notifications.
Posted Last updated
.
Post marked as solved
7 Replies
12k Views
So I've read that to clear notifications out of the notification center, you simply use setApplicationIconBadgeNumber and set the value to 0. What if we wanted to clear the badge count without clearing the notification center messages? Is there a way to clear the badge count without removing the notifications?
Posted
by tlindeman.
Last updated
.
Post not yet marked as solved
1 Replies
499 Views
I have an iPhone & iPad app that does not contain an Apple Watch app. When the app receives a push notifications, and my phone is locked, I receive the notification on my Apple Watch. However, the image in the notification is missing: When I swipe down on the watch, the image is also missing on the received notification. On the phone, the icon displays correctly. My watch is a Series 5 (44mm) A2095. Below is all the icons present in my asset catalog. Please help!
Posted
by Codemis.
Last updated
.