Hi,
there is a issue that iOS background NFC scanning will only provide a notification result, It need user click to enter my APP, can I have any method to enter my APP directly without user action ?
Notifications
RSS for tagLearn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have been watching the following moment from wwdc (Design dynamic Live Activities):
https://developer.apple.com/videos/play/wwdc2023/10194/?time=728
It suggest that you should 'tick' between multiple live activities of your app:
When you want to show multiple sessions for your app going on at once, consider ticking between the display of them to continue to give users an eye on everything that’s going on.
How can I tick between them? More specifically how can I do that when my app is in the background?
I'm working with a deeplink I have to implement to my app. The deeplink is working because in some cases i will explain later the method is being executed. So when I tap the deeplink with a deeplink-tester-web I detect if the url is which I want and, if it's the case, i post a notification to NotificationCenter with a string parameter I need.
Case 1. I tap the deeplink when the view controller with the addObserver method is at the background with the app itself. It works (the only case)
Case 2. The app is closed so the deeplink opens the app directly in that view controller (the method is no being called event if the notification is there) Why?
Case 3. The app is at the background but in another screen. When I tap the deeplink and, after returning to the app, travel to my viewController the method is not called when the ViewController becomes visible. Why?
I've not seen anything in the documentation that can help me and i cannot access to the array of observers because the API does not allow that
Thanks. Any help will be appreciate.
Code:
When the deeplink is tapped the app delegate method that manages universal links call to this code when the url is a specific one
@objc func handleRecommendedOffer(offerId: String) {
NotificationCenter.default.post(name: .deeplinkRecommendedOfferNotification, object: nil, userInfo: ["offerId": offerId])
}
In my viewcontroller viewDidLoad (i've tried also viewWillAppear too):
NotificationCenter.default.addObserver(self, selector: #selector(goToDetail(notification:)), name: .deeplinkRecommendedOfferNotification, object: nil)
@objc private func goToDetail(notification: Notification) {
if let userInfo = notification.userInfo, let offerId = userInfo["offerId"] as? String {
showLoading()
getOfferViewModel.getOfferDetail(id: offerId)
}
}
Topic:
App & System Services
SubTopic:
Notifications
Hello ,
We are trying MDM APNs push using following command
curl.exe -X POST --http2 -k -v --cert PushCert.pem --cacert cacert.pem https://api.push.apple.com/3/device/9BFDFB46D48159D16E5DC80391B765EE99524CF294BB4BF9FB5AEA7A5F3FFD79 -d "{"mdm":"84F0C145-5963-4F06-9D11-DFBDB45802D5"}" -H "apns-topic: com.apple.mgmt.External.c217c1bf-ad51-42a9-9108-2e92ef705b2a" -H "apns-push-type: mdm"
The command process correctly there is no error but device doesn't receive the Apns push.
At the same time the older device recives the Apns push but newer device not.
What can be the cause,how to debug this issue.
There is one xpc server and two xpc clients (clientA and clientB). When clientB sends a message to the xpc server, xpc server fills a value for dummyString in it's memory and I want clientA to know that dummyString got updated and also the new value for this dummyString. The updation of dummyString is not something that happens often.
Two options we tried:
Have a timer for 5 seconds in clientA and keep polling and request for the value of this dummyString.
Setup a darwin notification in server that gets posted whenever dummyString is being updated. clientA receives requests for dummyString value only when it observes a notification being posted.
Which of these two approaches causes the least delay for clientA to know the updated value of dummyString?
Hi, hope you're all doing well. I have a real brain-cracker here... Have been looking into this for the past 20 hours, but can't figure it out.
We built an iPhone app that essentially functions as a shell around a PWA Web-App using WebView. The tricky part here to set things up was getting the Push Notifications to work. Eventually we got this working though (with help of Firebase), and the app has been working great for the past 7 months. Now, all of a sudden as it seems, when users first open up the app, there's no FCM token generated and passed on to the WebView instance running javascript. Or at least, the listening event ('push-token') no longer gets fired.
Users who already have their FCM token generated and stored earlier on, receive push notifications without any issues. It's just that no new FCM tokens seem to be generated - or at least no longer passed to the WebView's javascript code. I know this for a fact as my tests turn out that the following event (present in my PWA Web-App JS code) no longer gets fired. Again, this worked fine before. I have NOT updated the native app since 6-7 months.
`/* LISTEN FOR FCM (PUSH MESSAGES) TOKEN FROM NATIVE (IOS) SHELL: */
window.addEventListener('push-token', function(event) {
//alert("Push Token registration event called from native shell");
if (event && event.detail) {
var token = event.detail;
window.fcmPushMessageToken = token;
localStorage.setItem('fcmPushMessageToken', token);
//alert("Received FCM token: " + token);
registerDeviceForPushMessages();
}
});`
Hereé the part in my native iOS code that used to call this event from within the native iOS shell:
func handleFCMToken(){
DispatchQueue.main.async(execute: {
Messaging.messaging().token { token, error in
if let error = error {
print("Error fetching FCM registration token: \(error)")
checkViewAndEvaluate(event: "push-token", detail: "ERROR GET TOKEN")
} else if let token = token {
print("FCM registration token: \(token)")
checkViewAndEvaluate(event: "push-token", detail: "'\(token)'")
}
}
})
}
func checkViewAndEvaluate(event: String, detail: String) {
if (!EPDriversApp2.WebView.isHidden && !EPDriversApp2.WebView.isLoading ) {
DispatchQueue.main.async(execute: {
EPDriversApp2.WebView.evaluateJavaScript("this.dispatchEvent(new CustomEvent('\(event)', { detail: \(detail) }))")
})
}
else {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
checkViewAndEvaluate(event: event, detail: detail)
}
}
}
Again, I have not updated the native iOS app OR the WebApp's code. This just stopped functioning all of a sudden.
One "weird" thing I noticed that there's no Provisiong Profile associated with the app. I'm not sure whether this was ever the case before, to be honest. Is this even mandatory? Can not having a Provisiong Profile associated with the app effect the ability of an already pusblished app for generating Push Notification tokens?
iOS has a feature that suppresses or limits the display of push notifications when multiple notifications are sent in quick succession (often referred to as rate limiting or filtering). Specifically, how many notifications within what timeframe might trigger such suppression?
Topic:
App & System Services
SubTopic:
Notifications
Hello Everyone,
I somehow missed to renew the APNS Certificate,
I am new to Apple Ecosystem, I can not see the expired or any Certificates under
Certificates, Identifiers & Profiles
Can anyone help me with this!
Hi when setting the language to iOS 6 my app crashes on this piece of code:
func registerForPushNotifications() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
print("Permission granted: \(granted)")
guard granted else { return }
self.getNotificationSettings()
}
}
It has to do with the requestAuthorization
When I restart the app it crashes immediately. This is because I had already made a choice for this.
When I change the language back to swift 5 it works fine again.
Removing the self.getNotifcationSettings has nothing to do with it.
Also tried to add @MainActor to the function.
This is the tread where it crashes on:
Thread 7 Queue : com.apple.usernotifications.UNUserNotificationServiceConnection.call-out (serial)
Does anybody have a idea how to fix this?
Topic:
App & System Services
SubTopic:
Notifications
We are struggling with the lack of information provided by Apple re: Apple Push Notification service server certificate update
We want help from other developers on HOW TO: make sure that both old and new server certificates are included in the Trust Store
Exactly HOW is this done?
What is the Trust store and how is it accessed?
Is this done for our account once OR for each for the apps utilising APNs?
Can anyone assist?
Thanks
Louise
Topic:
App & System Services
SubTopic:
Notifications
Hi there,
I’m currently working on an app designed for doctors to respond to life-threatening situations in hospitals. The goal is for critical alerts to trigger an alarm, regardless of whether the app is in the foreground or background. The critical alerts entitlement is already set up, but there’s a limitation: I can only attach a 30-second audio file to the notification, as I can’t run code to loop the sound when the app is swiped away.
Does anyone have suggestions on how I might approach this problem?
Thanks so much in advance!
Topic:
App & System Services
SubTopic:
Notifications
Facing issue while sending push notification through the application. The APNs certificate is valid.
Below is the error log.
System.AggregateException: One or more errors occurred. ---> PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult)
at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult)
--- End of inner exception stack trace ---
at System.Net.Security._SslStream.EndWrite(IAsyncResult asyncResult)
at System.Net.Security.SslStream.EndWrite(IAsyncResult asyncResult)
at System.IO.Stream.<>c.b__53_1(Stream stream, IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncTrimPromise1.Complete(TInstance thisRef, Func3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at PushSharp.Apple.ApnsConnection.<SendBatch>d__21.MoveNext() --- End of inner exception stack trace --- at PushSharp.Apple.ApnsServiceConnection.<Send>d__2.MoveNext() --- End of inner exception stack trace --- ---> (Inner Exception #0) PushSharp.Apple.ApnsNotificationException: Apns notification error: 'ConnectionError' ---> System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndSend(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndWrite(IAsyncResult asyncResult) --- End of inner exception stack trace --- at System.Net.Security._SslStream.EndWrite(IAsyncResult asyncResult) at System.Net.Security.SslStream.EndWrite(IAsyncResult asyncResult) at System.IO.Stream.<>c.<BeginEndWriteAsync>b__53_1(Stream stream, IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncTrimPromise1.Complete(TInstance thisRef, Func3 endMethod, IAsyncResult asyncResult, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at PushSharp.Apple.ApnsConnection.d__21.MoveNext()
--- End of inner exception stack trace ---
at PushSharp.Apple.ApnsServiceConnection.d__2.MoveNext()<---
Topic:
App & System Services
SubTopic:
Notifications
If a server is sending a push to an app, then how can it know whether it should be sending the push using the Apple sandbox push server, or the production server?
If the app is on the app store or testflight then it needs to be using the sandbox server, but if the app is being run via XCode interactively as devs are developing/testing then the push needs to be sent via the sandbox server.
But the server itself has no idea if the app was installed via Testflight/app store/XCode/ or a development .ipa. So the server can't know how to send the push.
The app has to send the push token to the server anyway, so the app could inform the server which environment it should be sent over. But then how can the app detect that itself?
A naive answer is to use #ifdef DEBUG to detect this, but that is incorrect. Which environment a push should be sent over is not correlated with that. For example an app could be being run with a debug scheme or a release scheme, but in both cases if the app is installed/running via xcode then the push environment has to be the sandbox.
So my question is, is there a way the app can detect which push environment a push should be sent over in order than it can instruct the server accordingly?
Hello Apple Support Team,
We are using auto-renew plans in our app
We have set the webhook URL in our App Store Connect account to get the Store server notification to get the auto renew data for an user
The issue is when a user purchases any auto-renew plan at the auto-renew time, we are getting null data from the Apple side.
We have printed the log's data to check what data are coming from the Apple webhook. we have attached our logs data please check it and let me know what can we do to resolve this
Topic:
App & System Services
SubTopic:
Notifications
Tags:
Subscriptions
App Store Server Notifications
App Store Server Library
Hey there,i start a live activity,but it not works, and sometime it can work;
apns-unique-id 46445cfa-1bf6-0f63-5ea3-2afa53e02b0d
and it show that "
2025年5月19日 GMT+8 15:13:25.836
received by APNS Server
2025年5月19日 GMT+8 15:13:26.244
discarded as application was not registered"
but i did not know how can i do;
thanks for you help
I'm sending push notifications to a notification extension, and within the extension setting the threadIdentifier to be the same.
But I'm observing inconsistent grouping behaviour, and behaviour that changes over time.
The general iPhone settings are to display notifications as a Stack, and the app settings are to show on lock screen, notification center and banners and the notification grouping is set to by app (changing it to automatic doesn't affect the behaviour below).
Pushes are displayed on the lock screen grouped together, then if the device is roused and the screen swiped down to reveal the notification center then they are still grouped.
So far so good.
If the iphone is active then the notifications appear at the top of the screen, one by one, but in this case if there is a swipe down to reveal the notification center then the notifications are not grouped when displayed, but shown individually.
But then if one waits a few minutes and then displays the notification center for a 2nd time, sometimes now they will be grouped, but sometimes not.
Why are they not (always) being displayed as grouped in the notification center?
Our team also received this email regarding the APNS. I don't know if I need to do something or not, since I haven't found any information in SAP Forums either.
Our app uses the SAP Mobile Services push notifications.
If any of you know any information about this, please let me know.
Is there anyway that I could use AVAudioSession, AVAudioPlayer or anything similar in Notification Service Extension?
I am trying to implement Audio Playback in the Notification Service Extension to play specific audio file when receiving Notification regardless the app state(foreground, background or killed), but I am not able to activate audio session in Notification Service Extension.
NSError *sessionError = nil;
BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&sessionError];
success = [[AVAudioSession sharedInstance] setActive:YES error:&sessionError];
if (!success) {
NSLog(@"Error activating audio session: %@", sessionError);
}
Below is the error that I got when I am trying to run the code above in Notification Service Extension.
Error Domain=NSOSStatusErrorDomain Code=561015905 "Session activation failed" UserInfo={NSLocalizedDescription=Session activation failed}
Is there any callback available when a/all notifications is/are removed from notification tray?
I have a “1” above the setting app on my iPhone. However when I open settings there is no notification that shows up. I have tried force restarting and done the beta updates as they release however nothing works to got rid of it. What can I do?
Topic:
App & System Services
SubTopic:
Notifications