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 not yet marked as solved
1 Replies
285 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
by
Post not yet marked as solved
0 Replies
132 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
by
Post not yet marked as solved
0 Replies
163 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
by
Post not yet marked as solved
0 Replies
112 Views
Can we implement background activities for longer period of time after a silent push notification is sent?
Posted
by
Post not yet marked as solved
0 Replies
135 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
by
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
by
Post not yet marked as solved
2 Replies
297 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
by
Post not yet marked as solved
0 Replies
219 Views
Dear apple developer community... I am facing the problem on creating my own pushPacakge and .p12 webpush certificates file for safari push notifications. I follow all steps carefully on an official document here with my team. And also try to follow some tutorials on some blogs which corresponding to its. But it still doesn't work. Here's how my problem looks like I've got .p12 file then I've test to upload it into some push service like oneSignal, truePush and etc. It's able to upload the file but the push service still doesn't work. But if I used a provided .p12 from their service, the notification will working properly. I try to use my .p12 to generate a push package (pushPackage.zip). But the api log on my webServiceUrl keep showing me "{ logs: ['Signature verification of push package failed'] }". Even if I try all versions of AppleWWDRC (G1-G6) downloaded from here. And even I use an official php script (createPushPackage.php) file from apple apn document downloaded from here on the top right corner at companion file Here's what I've done so far to get my own .p12 file... Generate my own CSR file from mac keychain application Noted1: My appleId on my mac is an Admin role only on apple developer account (Not a Admin, Account Holder role) Noted2: I've try to enter an apple id with role Admin, Account Holder on a User Email Address field but it still doesn't work Login into an apple developer account console on apple developer site Go to identifier tab and create new webPushId identifier Enter description and webPushId(reverse domain name style which is web.com.herokuapp.kkwebpush) Come back to certificates tab and create new certificate (select webPushId radio button and click create) Choose webPushId that already created on step 4 from dropdown list then click on continue Upload CSR file that generated on step 1 into its Download .cer file Click on the downloaded .cer file from step 9 and generate .p12 file by keychain Here's how I create pushPackage.zip file Create folder to store all files needed ( reference from here ) which are AppleWWDRCA.cer Certificates.p12 (Generated from step 9 above) createPuchPackage.php (Official script from apple which already edit the path to Certificates.p12 and enter private key match with my Certificates.p12 password) intermediate.pem (Generated from export AppleWWDRCA.cer on keychain as intermediate.pem) pushPackage.raw (folder that contain both icon.iconset and website.json that already set matched webPushId and webServiceUrl inside website.json) So, the folder structure now look like this Then I start to run php createPushPackage.php inside this folder. After that I've got an unreadable format result on my terminal .But I still get a pushPackage.zip file stored at /tmp folder (At this point I think it might be fine with that unreadable format) . Head over to my tmp folder to move that pushPackage.zip file into my webServiceUrl endpoint directory for send a pushPackage when apple api model was called on window.safari.pushNotification.requestPermission ( Already set these 4 parameters below) url as my web service url to my endpoint websitePushID as my web site id registered on apple developer console userInfo as empty object {} callback as function as a callback function FINALLY MY FINAL QUESTIONS ARE... Are there any steps that I've missed? Why I keep getting { logs: ['Signature verification of push package failed'] } on my web service url log errors endpoint? Does my certificate is invalid? (If yes, what are all possible causes) Why I can't use my own .p12 file on other push services (oneSignal, truePush and etc.) that support custom upload .p12 file for safari push notification? * When I used a provided .p12 from their service, everything works fine (safari permission popup can appear). On the other hands, If I use my own .p12, I can upload its to their services but safari permission popup don't show up)? Any solution please? Thanks
Posted
by
Post not yet marked as solved
0 Replies
165 Views
Hello everyone! I am trying to implement push notifications in my WatchOS app. I have created the delegate class that handles the registration for remote notifications and that allows me to obtain the device token. Then I take the token and send it to Firebase, like this: func didRegisterForRemoteNotifications(withDeviceToken deviceToken: Data) {     FirebaseApp.configure()     var ref: DatabaseReference!     ref = Database.database().reference().ref.child("/")     let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }     let token = tokenParts.joined()      if let userID = UserDefaults.standard.object(forKey: "id") as? String {         ref.child("users/\(userID)/token").setValue(token)     } } Then I am using a Python Script to communicate with APNS. I am using the http library to get access to HTTP2. This is what I have got: payload = { "aps" : { "alert" : { "title" : "Hello Push", "message": "This is a notification!" }, "category": "myCategory" } } dev_server = "https://api.sandbox.push.apple.com:443" device_token = "9fe2814b6586bbb683b1a3efabdbe1ddd7c6918f51a3b83e90fce038dc058550" headers = { 'method': 'POST', 'path': '/3/device/{}'.format(device_token), 'autorization': 'bearer' + 'provider_token', 'apns-push-type': 'myCategory', 'apns-expiration': '0', 'apns-priority': '10', } async def test(): async with httpx.AsyncClient(http2=True) as client: client = httpx.AsyncClient(http2=True) r = await client.post(dev_server, headers=headers, data=payload) print(r.text) asyncio.run(test()) I have also downloaded the .p8 auth key file. But I don't really understand from the Apple Documentation what I have to do with it. What is the provider token in the headers? Am I doing the right thing with the token I receive from didRegisterForRemoteNotifications?
Posted
by
Post not yet marked as solved
1 Replies
256 Views
All our applications listed below, once installed in padOS15 (iPad mini 6 15.4.1) are not receiving any remote push notifications. We built our apps in XCode13.2.1. I also tried to install the latest XCode13.3.1 in macOS Monterey, but I got the same problem. It has no problem when installed on different devices and versions. Our apps: CLOMO SecuredBrowser for iFilter CLOMO SecuredMailer CLOMO SecuredDocs CLOMO SecuredContacts This is how to replicate it: Start the app Press the home button and the app goes to the background I change the profile settings on our server-side Wait for the remote push notifications. (the remote push notifications are received on other devices but not on this device) Expected result: remote push notifications should be shown on the device. When I checked the console log, I found that com.apple.Preferences removed delivered notifications as shown below. SpringBoard [com.apple.Preferences] Removing delivered notifications
Posted
by
Post marked as solved
4 Replies
344 Views
I'm trying to configure Local Push Connectivity. I already have Local Push Entitlement, and have install a provisioning profile with local push entitlement. It's build fine but when app start, PushProvider didn't active and start and Push Manager show error nil. I have done every instructions that sample code have provided. This is my project. In my application target, I have a bundle id com.my_team_name.my_app_name and in the app group name group.com.my_team_name.my_app_name In the .entitlement, I've set the required configuration: <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.developer.networking.networkextension</key> <array> <string>app-push-provider</string> </array> <key>com.apple.developer.networking.wifi-info</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>group.com.my_team_name.my_app_name</string> </array> </dict> </plist> Info.plist has noting to change And I have a PushManager Class with this code class AppPushManager: NSObject, NEAppPushDelegate{ func appPushManager(_ manager: NEAppPushManager, didReceiveIncomingCallWithUserInfo userInfo: [AnyHashable : Any] = [:]) { } static let shared = AppPushManager() private var pushManager: NEAppPushManager = NEAppPushManager() private let pushManagerDescription = "PushDefaultConfiguration" private let pushProviderBundleIdentifier = "com.my_team_name.my_app_name.PushProvider" func initialize() { if pushManager.delegate == nil { pushManager.delegate = self } pushManager.localizedDescription = pushManagerDescription pushManager.providerBundleIdentifier = pushProviderBundleIdentifier pushManager.isEnabled = true pushManager.providerConfiguration = [ "host": "my_server.local" ] pushManager.matchSSIDs = ["my_wifi_ssid"] pushManager.saveToPreferences(completionHandler: { error in print("error? \(String(describing: error))") print("is active: \(pushManager.isActive)") }) } } In my extension, A PushProvider Target. I have a bundle id com.my_team_name.my_app_name.PushProvider and in the app group name group.com.my_team_name.my_app_name In the Info.plist of my extension, I've added the required configuration: <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.networkextension.app-push</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).PushProvider</string> </dict> the .entitlement file have the same contents as the application. and I have created the extension class "PushProvider.swift" as follow: class PushProvider: NEAppPushProvider { ... } When I run the application, I got this printed out error? nil is active: false I think it might be something with providerBundleIdentifier in Push Manager. Have anyone know what I've missing?
Posted
by
Post not yet marked as solved
0 Replies
162 Views
Hi, I'm creating an iOS app to assist a user with cooking recipes based on Cooklang files. Cooklang supports setting multiple timers and I want to implement this feature. I use Local Notifications and schedule timers successfully. But here's the problem: my timer notification doesn't produce any sound if phone is in a quiet mode. Does anybody know if it's possible to ignore quiet mode? Or some other way to create timer...
Posted
by
Post not yet marked as solved
0 Replies
104 Views
I was seeing the example that is provided by Apple and I don't really know how to implement the network extension. I searched in the capabilities and I tried to add a Network Extension target but I didn't find the provider type for App Push Provider. I am new in apple development and it is probably that it is a easy way to do this but I didn't find how. PD: I am using Xcode 13.3.1
Posted
by
Post not yet marked as solved
0 Replies
147 Views
Hi Team , I am facing an issue with one of the scenario in Actionable Push Notification. Case: On long press of notification , we get two actions "Accept" and "Review". On click of Accept , an api call triggers. If the API call is success we don't have to do anything but if the api call fails , we have to open the app and redirect the user to specific screen on app. There is a option to get the app on foreground on click on Accept Button, since app should not open on click of accept button but it should open when the api call gets fail on click on accept button that option is of no use. Another option I tried is to use openURL method, that also doesn't work when the app is in background How can I solve this ?
Posted
by
Post not yet marked as solved
0 Replies
144 Views
Currently, I work with CKSubcription and remote notifications. I have a question concerns application(_:didReceiveRemoteNotification:fetchCompletionHandler:) method. In Apple's documentations we can read: As soon as you finish processing the notification, you must call the block in the handler parameter or your app will be terminated. Your app has up to 30 seconds of wall-clock time to process the notification and call the specified completion handler block. In practice, you should call the handler block as soon as you are done processing the notification. Source: https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1623013-application The method works correctly. My app "wakes up" when got a notification (to observe that, I use option + command + escape). Do I correctly undrestand? - when I call hadler block, should app close immediately? My app closes after 30 second, even if I put only completionHandler(...) in this method. I asked beacuse in the documentation we can read. Your app has UP to 30 seconds Thank you in advance.
Posted
by
Post not yet marked as solved
0 Replies
185 Views
Hello, I've implemented Notification Service Extension as well as push notification in my app. I choose Notification Service Extension as the scheme and then run the whole project. The main app runs well. But when I send a message to my device, I immediately see an alert banner poping up. The content in it has not been modified, which indicates the Notification Service Extension does not work. Also I didn't see any logs printed out from the notification extension. At the meantime, below error messages have been printed out on console under the name of "TestAppPushNotificationExtension" **2022-04-22 00:20:14.818476-0700 TestAppPushNotificationExtension[3594:131852] Bogus event received by listener connection: &lt;dictionary: 0x24e1cbb20&gt; { count = 1, transaction: 0, voucher = 0x0, contents = "XPCErrorDescription" =&gt; &lt;string: 0x24e1cbcb8&gt; { length = 18, contents = "Connection invalid" } } 2022-04-22 00:20:17.797906-0700 TestAppPushNotificationExtension[3594:131852] [lifecycle] WARNING: Did not receive handshake message from the host after waiting ~2 seconds. THIS MAY BE A SPURIOUS LAUNCH OF THE PLUGIN due to a message to an XPC endpoint other than the main service endpoint, or the CPU is highly contended and this extension or its host is not getting enough CPU time. ** I've followed this article(https://www.amarendrasingh.com/swift/notification-service-extension-not-working/) and tried every recommended way to debug. But I still didn't find a way to resolve it...
Posted
by
Post not yet marked as solved
1 Replies
481 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
by