Hi all,In our application we Use VoIP Type push notifications to give a heads-up for the mobile phone.This allows the mobile phone to:1) If the application is killed, start it in background2) If the application is in Background, start running the application statemachine3) If the Phone is in deep sleep, Wake up and start the application in BackgroundDue to the above, our application arrives in a state where we can receive an incoming voip Call.It has been observed that there is a delay in the push notification arrival at the mobile phone.Delayed arrival/delivery of Push notification has been measured of about 6 sec or sometimes never arrives.This espicially is the case when we have an iPhone without sim-card.Note :- This was tested on a controlled setup with large number of iterations with good WiFi and internet connectiviy)- We ensured during testing that the push was actually dispatched to APNS.It is unknown as to what exactly causes a variation in the arrival of the voip notification.Can someone explain why :- Voip messages arrive late depite they should be 'instant' ?- What could explain the difference in measurments with/without sim card ?Best regards.
User Notifications
RSS for tagPush 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
154 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I don't know what could be wrong but my UNNotificationServiceExtension is never getting called by any push from FCM. I call the FCM from a Python3 script and so far it works (I get a push notification but always with the default text and not the modified one). firebaseHeaders = {
"Content-Type":"application/json",
"Authorization":"key=MYKEY"
}
firebaseBody = {
"to":devicetoken,
"priority":"high",
"mutable-content":True,
"apns-priority":5,
"notification": { "titlelockey":"push.goalReachedTitle", "bodylockey":"push.goalReachedContentRemote", "bodylocargs":[str(entry['value']), entry['region']], "sound":"default", "badge":1 },
"data": { "values":data, "region":entry['region'], "value":entry['value'] }
}
firebaseResult = requests.post("https://fcm.googleapis.com/fcm/send", data=None, json=firebaseBody, headers=firebaseHeaders)
My Extension is also pretty basic (for testing) and I already tried to remove it and add it again to my main app project without success. class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
if let bestAttemptContent = bestAttemptContent {
bestAttemptContent.title = bestAttemptContent.title + " [TEST 123]"
contentHandler(bestAttemptContent)
}
}
override func serviceExtensionTimeWillExpire() {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
contentHandler(bestAttemptContent)
}
}
}
Anyone has a idea what I still can check, test or miss?
We have configured the push notification service (Server-provider) to communicate with APNS with hostname: api.sandbox.push.apple.com and Port: 443. APNS request is going successfully but from APNS to device (iPhone 6S ) not coming.
We have whitelisted the above port and other ports also(2195, 2197). but. still not able to receive the notification.
We have also cross verified with the old gateway.sandbox.push.apple.com:2195 and it's working fine but with new api.sandbox.push.apple.com:443, not working.
Could someone from Apple Community help us to get resolved this issue?
Thanks in advance!!
UNNotificationRequests with a UNLocationNotificationTrigger created using a CLBeaconRegion can be scheduled and are returned in the pending list when the getPendingNotificationRequests method is called on UNUserNotificationCenter.
However, they never trigger based on beacon region entry or exit.
This is a change in behavior from iOS 14.
I can't find any reference to this change in the WWDC21 presentations. Can anyone confirm if this change is intentional and documented anywhere or likely a bug.
Hello everyone!
Our team is in the middle of developing a new sleep tracking app with a bunch of additional features including a custom alarm clock. And we need Critical Alerts entitlement for this feature to work as only such notifications (critical interruption level for iOS 15) can break through Silence Ring & Do Not Disturb mode, which is necessary as users obviously won't wake up without the alarm actually going off.
We've applied twice already, clearly stating the purpose of this entitlement, but both times received the same answer: "Unfortunately, this API is not designed for the use you've identified".
While Apple Developer documentation on the matter is rather elusive and states that, among others, home- & health-related purposes are allowed, I couldn't find any straightforward info about our particular case. Moreover, I can easily name a few apps in the Health & Fitness category with exactly the same alarm clock functionality that works and obviously utilizes Critical Alerts entitlement.
So I wonder, can anyone give a piece of advice on how to get this entitlement? Maybe we need to provide some additional info or meet some unannounced conditions? Any info will be highly appreciated.
Hi,
When receiving provisional user notifications in iOS 15 the "Turn Off..." button works fine, but the "Keep..." button doesn't save the settings. "Deliver Immediately" option doesn't do anything and "Deliver in Scheduled Summary" hides the buttons, but they appear again in next notification.
I've noticed this behavior with several different apps, for example Reddit. Does anyone know anything about this? I have also submitted a bug to Apple but no response so far.
since iOS 15, the notification icon doesn't work as it should.
the icon has been defined:
the situation happens in the same app, but in different ios versions
when ios < 15 the black icon is shown in the notification (correctly)
now, iOS 15 the white icon appears (I have no idea why)
has anyone had a similar problem?
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?
Hi,
We need to use silent notifications in our app, even when the user kills the app.
We requested Apple to get a NSE Filtering Entitlement on December 02, 2022 with follow-up number: 814879299
But after nearly 2 months, we still haven't got a response.
So we also sent a TSI (Technical Support Incident) on January 09, 2023 with follow-up number: 817249684. DTS (Developer Technical Support) said that we need to use this specific entitlement and he has no involvement in the entitlement request process.
We need a quick response for the NSE Filtering Entitlement because our business depends on Apple's response.
@Apple, is it possible to get an estimation date for the response?
@iOS_developers, how long have you been waiting for that permission?
Dear fellow developers,
I have an issue where my didReceiveRemoteNotification method in the AppDelegate is never called. Here's what I did:
I am developing a SwiftUI application for iOS 15 and 16 and am currently running tests in an iPhone 14 Pro Simulator. My Xcode version is 14.2 and the simulator is running iOS 16.2.
I am of course talking about the AppDelegate's application:didReceiveRemoteNotification:fetchCompletionHandler: method, not the deprecated one.
I embedded the AppDelegate in the following way:
@main
struct MyApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
...
}
The integration of my AppDelegate does work in general, meaning the didFinishLaunchingWithOptions is called.
I added the background modes capability to my app, including both "Remote notifications" and "Background processing".
With this configuration, I would expect the AppDelegate's method to be called. I tried sending different push notifications with different payloads and headers while having the app both in the background and foreground but without success.
Just to rule out mistakes on my side that are obvious to someone else, this is how I embedded the method into my AppDelegate:
class AppDelegate: UIResponder, UIApplicationDelegate {
...
func application(
_ application: UIApplication,
didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
) {
print("Method called!")
completionHandler(.noData)
}
}
And here are a few payloads and headers that I tested. I tried all of the following payloads with the following headers in any combination.
apns-push-type=alert or apns-push-type=background
apns-priority=5 or apns-priority=10
Example 1: Visible notification
{
"aps": {
"alert": {
"body": "Test"
},
"badge": 1,
"content-available": 1
},
"test": "data"
}
Example 2: Silent notification without badge update
{
"aps": {
"content-available": 1
},
"test": "data"
}
Example 3: Silent notification with empty alert block and badge update, based on ideas from this thread
{
"aps": {
"alert": {},
"badge": 0,
"content-available": 1
},
"test": "data"
}
As I said, no matter whether my app is in the foreground or background, the method is never called. At the same time, the userNotificationCenter(_:willPresent:withCompletionHandler:) method of the UNUserNotificationCenterDelegate is called when the app is in the foreground. At this point, I am running out of ideas what I could possibly be doing wrong, so I hope someone else has an idea what else to try.
Hi,
How can I send push notification for point update and promos to my loyalty wallet users. Currently I get push notification Id when user install loyalty wallet and I use it for sending wallet updates. But when I tried to use this push notification id for custom APN messages it doesn't appear anywhere.
Thank you.
Hello Everyone!
After push notifications were enabled we got to work on this feature. for our PWA.
The problem that we are having is that they work great for a little bit and then they suddenly stop working. We thought it was our problem but after doing some research I found that many other developers are having this same issue.
Push notifications work perfectly on Android but don't reach ios users.
Is anyone else having the same issue? Can something be done to fix this?
Thanks!!
Hi there,
Our app is installed on tablets provided to customer workers for performing tasks. We're currently implementing Push Notifications using AWS SNS and FCM. The goal is to send data-only (silent) push notifications to trigger a function that creates a record in the app's local DB.
This approach allows us to control how the message is displayed in the foreground and background using Notifee. While this works well on Android in all states (foreground, background, killed), we're facing an issue on iOS, specifically in the release build.
The silent push notifications only reach devices when the app is in the foreground, not in the background or killed states. Normal push notifications work fine, but we require the ability to send silent notifications for better processing control. Upon researching, we discovered that Apple has strict guidelines for these notifications to prioritize user experience, battery usage, spam prevention, and privacy. However, in our case, the tablets are dedicated work devices with only our app installed.
Given this context, is there a reliable solution to send silent push notifications to iOS devices with the app in the background or killed states?
Hi. I developed a PWA app with fcm because iOS supports push api from iOS 16.4ver
My server push message to fcm with this format.
As you can see, we use webpush.fcmOptions.link to open the url page when users touch notification. On web browser and android, this option works but ios pwa don't. iOS just opens the PWA but can't open the url specified in fcmOptions.link.
Is there anyone who knows about this?
Can I fix it?
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.
Hello everyone
Our application started to spam the Firebase Push Notifications when the device had the iOS 17 Beta. This behavior does not happen in iOS 16, but it was reproduced in many iOS 17 Beta (Beta 3, 4 & 5).
The issue goes like this:
Our backend service uses an SDK Firebase to send one notification
The user receives the notification
Then after some minutes, the device starts to receive the same push notification with the old date-time, by intervals of 5 to 15 minutes
We also got reports of other people with the same issue:
https://stackoverflow.com/questions/76620368/spam-of-fcm-push-notifications-on-ios-17-beta
https://github.com/kreait/firebase-php/issues/814
You can see the following screenshot of the output of this after 2 hours:
I've set up a Notification Content Extension for my app, but it's not getting called(tried both local and remote push). I've read the Apple dev guide, and I've set up everything as it says. https://developer.apple.com/documentation/usernotificationsui/customizing_the_appearance_of_notifications
I've looked over the common issues (setting proper deployment targets and setting category identifiers from the backend and in the .plist)
After receiving the notification, I'm not able to get the expanded view and neither is the didReceive(_ notification: UNNotification) of my extension view controller getting invoked. Is there something I'm missing while doing the extension setup, I m not able to figure out the problem?
Also, I m not able to understand this note from apple
"Notification content app extensions are supported only in iOS apps"
when all the Notification content Extension APIs are provided for MacOS also?
I'm currently working on a Swift project for an iOS app that involves receiving notifications. The app is designed to play different sounds based on a specific parameter when a notification arrives. The correct behavior to follow is as follows. There are two types of notifications in the project: start notifications and stop notifications. Once the app receives a start notification it starts an audio player, the audio lasts X seconds but is looped by the player so it potentially lasts forever. When the app receives the stop notification, the player stops and the sound stops.
This works great when the app is in the foreground.
When the phone is locked and therefore the app is closed, the sound that is heard is X seconds without the sound being repeated as it happens in the foreground. Furthermore, it often happens that when the stop notification arrives, the player does not stop and continues until the end of X s time.
Does anyone have an idea of how to put the loop to the sound of the notification with the phone locked and be sure that when the stop notification arrives the player stops?
The sound stop works well on some devices while on others it doesn't even with the same iOS versions.
Hi,
when sending notifications either via APNS remotely or locally on watchOS, they are delivered with a small but significant delay of ~12 to 20s. That doesn't sound like much, but when e.g. the notification is read on AirPods by Siri via the iOS companion app on the phone it's quite annoying having to wait for the long-look notification UI to appear on the watch to e.g. send a quick reaction.
Interesting: If the watch is not connected to the phone, notifications are delivered as quick as on the iPhone (<1s delay).
That makes me think that this behavior must be related to the notification forwarding feature as described here https://developer.apple.com/documentation/watchos-apps/enabling-and-receiving-notifications .
For a "Dependent watchOS app with an iOS app" it is stated that "You can either send the notification just to iPhone, or send it to both devices. In either case, the system ensures that the user only receives one notification at the best destination."
So the watch must somehow coordinate with the iPhone to not show a notification if the "same" (same APNS collapse id?) notification is delivered to the phone as well (?).
Is there a way to disable this behavior?
Thanks!
Quirin
What is Settings app -> Safari -> Advanced -> Experimental Features -> Push API for?
I thought it would be possible to receive WebPush on Safari, but it didn't work.
Also, I thought it was a setting related to WebPush, which operates when a PWA-compatible site is added to the home screen, but I was able to receive it regardless of this setting.
Thank you,