Post not yet marked as solved
Hello fellow developers, I am creating an application and it contains critical alerts and for that I have given the permissions but unable to find any implementations. I am using Flutter environment to develop my application and want that the application should emit a sound even if it is silent or in 'Do Not Disturb' mode.
Post not yet marked as solved
Hello Apple Developer Community,
I am reaching out for insights regarding an issue we're facing with Apple Push Notification Service (APNS). Despite successful implementation and functioning for other apps, we are consistently receiving a 400 TopicDisallowed error when trying to send push notifications to one specific app. Here's a detailed overview:
Issue Summary: Push notifications sent from our server to a specific app result in a 400 TopicDisallowed error from APNS. This problem is unique to this app; notifications to other apps with similar configurations are successful.
Successful Tests via Apple CloudKit Console: Notably, when using the Apple CloudKit Push Notification Console, push notifications to the problematic app are sent successfully, indicating the app's basic setup is configured correctly.
Key Details:
The topic field in the push notification request matches the app's bundle ID exactly.
The app is downloaded from the App Store, and we are using the production environment on our server.
Payload structure, APNS endpoint, and APNS Auth Key are consistent across all apps we manage.
Device tokens for the problematic app validate successfully using the tool in the push notification console.
Detailed server-side logging has not revealed significant differences between successful and unsuccessful push notification requests.
Given these factors, we are struggling to identify the root cause of this specific issue. I am wondering if anyone in the community has faced a similar problem or could offer any insights.
Any help or guidance would be immensely appreciated.
Thank you in advance!
Post not yet marked as solved
I noticed that the numbers given for the individual states do not add up; i.e. if I add everything other than "Received by APNs" I get what amounts to ~95% of that. Is that expected? And if so what happened to the remaining 5%?
Post not yet marked as solved
I made a simple applescript app to run a shell script and display a notification when it ends, it runs pretty well but I did't want the app appearing in the dock, so I added LSUIElement = true in the info.plist, and now the script runs but the app does not notify. Is there a way to have a background app (does not appear in the dock) with the ability to display notifications?
Post not yet marked as solved
I have a NotificationContentExtension, to create a custom view for a notification.
This view contains several links (crucially, these are not defined as .
The desired behavior is to open the url in a webview in my main app. However, using self.extensionContext.open opens the url in safari. Given that UIApplication.shared is not available in an extension, how should I go about opening a url in my main app from a notification?
Post not yet marked as solved
Is there a way for the app currently playing music or voice in the background to know when a Critical Alert or push comes?
Currently, my app contains code that stops playback when a call comes in while music or voice is playing in the background.
So, if a call comes in during playback, it stops normally.
However, there is a phenomenon in which playback cannot be stopped when a Critical Alert or push comes.
When a Critical Alert or push comes to the device, is there a way in the code for the app currently playing music or voice in the background or foreground to know at that moment?
We are not sending out Critical Alerts or pushes.
I would like to know how to resolve the situation when receiving a Critical Alert or push sent to all users in one country.
Post not yet marked as solved
Hello Forum,
If I send the device the "DeviceInformationCommand.Command.RequestType= DeviceInformation" command and "InstalledApplicationListCommand.Command.RequestType = InstalledApplicationList" command ,
it can be sent successfully, but I don't get a response from the device.
https://developer.apple.com/documentation/devicemanagement/get_device_information
------------- our log ----------------------
general.log.5:[2024/03/27 13:23:30] (172.31.54.87) I #TaskUpdateInformationHandler - did:14379, udid:63a6d7edc9f1128808aaee49d80e9539b5fd9cdd, mdm_task_uuids:['0aa5f838-1891-4a9b-b4fd-9d7c0aa365d3', '3f401ea8-be87-499b-a4be-fea2b1dab379'], result:ok, cid:117
general.log.5:[2024/03/28 03:06:34] (172.31.76.98) I #TaskUpdateInformationHandler - did:14379, udid:63a6d7edc9f1128808aaee49d80e9539b5fd9cdd, mdm_task_uuids:['c46b8523-40cd-4c7e-8a5d-0e49c9d26106', '8a99b664-df27-4bc9-8f41-fe39e3a7f3bc'], result:ok, cid:117
It is transmitted successfully to the Apple MDM server,
but there is no response from the device.
However, policy distribution such as PushSetting works normally.
I would like to get some document or help that I can refer to.
Thank you.
Post not yet marked as solved
After the update to iOS 17, tapping on message notification shown on CarPlay Dashboard is navigating to the CarPlay app instead of announcing the message notification.
Announce Notifications turned ON
Announce Messages turned ON
Announce New Messages option is selected
Other apps message notifications are announced as expected when tapping on the notification implying that the settings are set as required.
Enabled com.apple.developer.carplay-communication
Class CustomCarPlaySceneDelegate: UIResponder, CPTemplateApplicationSceneDelegate {
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
didConnect interfaceController: CPInterfaceController)
func templateApplicationScene(_ templateApplicationScene: CPTemplateApplicationScene,
didDisconnectInterfaceController interfaceController: CPInterfaceController)
func scene(_ scene: UIScene, willContinueUserActivityWithType userActivityType: String)
}
Post not yet marked as solved
Hi,
I'm experiencing a bug that only occur in iPhone X/XS that run iOS 16.2. I couldn't tap the push notification when the app is already active. I need to trigger a feature when the push notification is tapped. When the app is on the background, it worked. But when the app is already active / on the foreground, it didn't. I tried this on an iPhone 8 Plus running iOS 16.2.1 and iPhone 14 and iPhone XR running iOS 17.1.2, but this bug didn't occur (ie. the tap was working and I can call didReceiveResponse callback). Why does this happen? Can anybody help me?
Thanks.
Post not yet marked as solved
Hello,
Scenario:
My app is running in the foreground, logged into my backend server and I have registered for push notifications and received a push token. I have pin code activated on the phone.
I make some code changes and re-flash it in Xcode, the app is running in debug mode wired to Xcode.
I put the app in the background and lock the screen and wait 30 sec until data protection is activated and the keychain cannot be accessed.
I send a push notification. In this case didRegisterForRemoteNotificationsWithDeviceToken if often called with the same push token as I had before.
Data is protected in this state, hence I cannot access the auth token and send the token to the server. In this case it is not needed since the token is the same, but it got me a bit worried. In didRegisterForRemoteNotificationsWithDeviceToken I send the push token to the server, as the Apple docs recommend.
My concern now is: could didRegisterForRemoteNotificationsWithDeviceToken be called in a real scenario when the phone is locked and data protection is activated?
The Apple docs say:
Device tokens can change periodically, so caching the value risks sending an invalid token to your server.
And gives an example:
For example, UIKit calls the method when the user launches an app after having restored a device from data that is not the device’s backup data.
In this case, since the user is initiating it, the phone is unlocked so data should be unprotected. But that is one example, what more scenarios could there be that triggers this function, and could data be protected in those scenarios?
I'm worried that it could be triggered, even if its rare, in a state where data protection is activated, hence I cannot send the new push token to the server, and thus future remote notifications from the server will not be received by my app until the users logs out and logs in again.
Post not yet marked as solved
What interfaces do I use to propagate a CloudKit change in a shared zone to a notification/badge to all participants in the shared zone?
Assume I have a 'League' that is the root object in a shared zone and that N Players are members of the league. One of the players, the 'organizer', schedules a 'Game' that is open to any of the players. When the organizer creates the game (in the league's shared zone) and it is mirrored in CloudKit, how can the other players see it (as a timely notification)?
I already observe .NSPersistentStoreRemoteChange on NSPersistentStoreCoordinator and NSPersistentCloudKitContainer.eventChangedNotification on NSPersistentCloudKitContainer. Are these delivered in the background? Can/Should they generate a 'local/remote' notification for handling at the AppDelegate level? How?
Do I need to use a CKDatabaseSubscription looking for CD_Game records directly? (I'd rather not; because then I'd have a potential race between the remote iCloud database(s) and the local CoreData)
Post not yet marked as solved
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.
Post not yet marked as solved
I have a question about APNs specifications.
We are aware that if we delete the app, we will disable the device token managed by APNs. we intend to send a push notification from AWS SNS to APNs and if the device token is disabled, AWS SNS will identify that the app has been deleted from our phone.
I believe the specification is that iOS uninstall data is only available after the 8th day.
However, it has been a month since the uninstallation and still the APNs are not returning the device token as invalid.
Why is the uninstall data not available?
If there is a way to do this waiting up, please let me know.
Post not yet marked as solved
I'm tring to Send Notification using cURL Command for that i used curl commad
curl -v \
--cert "${CERTIFICATE_FILE_NAME}" \
--cert-type DER \
--key "${CERTIFICATE_KEY_FILE_NAME}" \
--key-type PEM \
--header "apns-topic: xobuya" \
--header "apns-push-type: alert" \
--header "apns-priority: 5" \
--header "apns-expiration: 0" \
--data '{"aps":{"alert":{"title":"title","subtitle":"subtitle","body":"body"}}}' \
--http2 https://api.push.apple.com:443/3/device/my-id
I have a also run this in order to get .pem
openssl x509 -inform DER -in aps.cer -out aps.pem
but i got error like this
` * Connected to api.push.apple.com (17.188.180.206) port 443
schannel: disabled automatic use of client certificate
schannel: certificate format compatibility error for aps.cer
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
Closing connection
curl: (58) schannel: certificate format compatibility error for aps.cer`
Post not yet marked as solved
Hi. I would like my App to be notified when the phone rings. No, not CallKit-CallKit is for VoIP and does not cover Cellular connections (as of 2/26/24) but, thanks. To continue..
I understand ages-ago there was a Telephony Kit or Framework but, has been discontinued. Has it been replaced with something else?
I would like something that seems very simple:a) when the phone rings my App is notified, b) when it stops ringing (combine all possibilities; sent to voicemail, user cancels, user answers) my App is notified.
Yes, I understand UserNotifications can make things run but, as I understand it this feature is for the App to schedule notifications, not receive them? If you know of something in UserNotifications that I can leverage I would appreciate your input.
Lacking other possibilities I find myself wondering about Siri integration. Siri is notified about system events and generates notifications based upon these events. Is there some way to place my App downstream from Siri and receive system notifications? Thanks everyone.
Hi All
I have some customer sound file named as .x-wav / .x-m4a, when specify sound file with extension .x-wav, like
content.sound = [UNNotificationSound criticalSoundNamed:@"mysound.x-wav" withAudioVolume: 1.0];
it will play defaultcrititicalsound.
if I tried
content.sound = [UNNotificationSound criticalSoundNamed:@"mysound.wav" withAudioVolume: 1.0];
then it worked
Post not yet marked as solved
I have been having a problem in our application while handling the VoIP notifications.
sometimes the didReceiveIncomingPushWith delegate function is invoked when a VoIP Notif is sent but when the call is accepted nothing happened from the caller's side, like the callback to the caller to notify him that the call is accepted doesn't happe.
And sometimes the didReceiveIncomingPushWith is not even invoked when a VoIP notif is sent.
here is a potion of the code.
func pushRegistry(_ registry: PKPushRegistry, didReceiveIncomingPushWith payload: PKPushPayload, for type: PKPushType, completion: @escaping () -> Void) {
NSLog("pushRegistry didReceiveIncomingPushWith() type:(type)")
// Handle the push payload
if let pushHashtable = payload.dictionaryPayload["aps"] as? [AnyHashable: Any] {
if let pushMessage = pushHashtable["alert"] as? String {
NSLog("push message=\(pushMessage)")
}
}
if type == PKPushType.voIP {
// Process the received push: if it is a VoIP push, this must be an incoming call because we deactivated push for REGISTER refresh from Kamailio server
if SipService.instance?.currentCall != nil {
// A call is already going on, ignore this VoIP push
NSLog("pushRegistry - voip push, and we already have a currentCall: we already received the INVITE, or it is a voip push for another call -> let's ignore it")
completion()
return
}
// We want to send a REGISTER anyway to get the pending INVITE message.
// Then, the incoming call will be notified in the SIP stack onCallNew(_ call: Call!) callback
// Since iOS 13, it is mandatory to report an incoming call immediately after a Voip push
// instead of waiting for the SIP INVITE (in EngineDelegate.onCallNew())
// See details here: https://forums.developer.apple.com/message/376630#376630
NSLog("pushRegistry - >= iOS 13 -> showing callkit before SIP INVITE")
if let callerSipUri = payload.dictionaryPayload["caller-sip-uri"] as? String {
NSLog("push caller-sip-uri=\(String(describing: callerSipUri))")
SipUtils.findCallerName(fromSip: callerSipUri) { callerName in
let customCallerName = (callerName ?? "Inconnu") + (CallKitService.instance?.CALLKIT_DEBUG_MODE == true ? " [PUSH]" : "")
DispatchQueue.main.async {
CallKitService.instance?.reportNewIncomingCallToCallKit(callerName: customCallerName) {
completion()
}
}
}
} else {
// That should not happen: Kamailio server is supposed to add the caller SIP URI in the VoIP push
DispatchQueue.main.async {
CallKitService.instance?.reportNewIncomingCallToCallKit(callerName: nil) {
completion()
}
}
}
// No call is going on, so we want to take this call, so we want to send a REGISTER if needed
SipNetworkMonitoring.instance.start()
} else {
NSLog("pushRegistry - not a VoIP push")
completion()
}
}
here is the reportNewIncomingCallToCallKit function implementation
func reportNewIncomingCallToCallKit(callerName: String?, completion: @escaping () -> Void) {
NSLog("Callkit - reportNewIncomingCallToCallKit from %@", callerName ?? "Inconnu")
let update = CXCallUpdate()
update.remoteHandle = CXHandle(type: .generic, value: callerName ?? "Inconnu")
update.hasVideo = true
// we may already have reported a new call to CallKit
// (since iOS13, we must do it in the didReceiveIncomingPushWith() callback)
// In this case, the CallKit UI is already showing with caller="Inconnu": we will update it with the caller name.
if let currentUuid = currentUuid {
NSLog("Callkit - already a CallKit call showing -> updating the existing call ...")
self.cxProvider?.reportCall(with: currentUuid, updated: update)
} else {
NSLog("Callkit - now CallKit call showing -> new call ...")
let newUuid = UUID()
self.currentUuid = newUuid
self.cxProvider?.reportNewIncomingCall(with: newUuid, update: update) { error in
completion()
}
}
// dont configure audioSession here, wait for the Callkit "didActivate audioSession" callback
}
just to clarify : findCallerName is a function to get the called name from a list from the Backend with an escaping closure, (I tried to overpass that function and just give a default name to the caller but still same problem) .
ANY HELP PLEASE?
Post not yet marked as solved
I have an iOS app, which uses Notification Service Extension (NSE) for its functioning. When I build the app, I get the following error:
error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier.
Embedded Binary Bundle Identifier: (null)
Parent App Bundle Identifier: com.example.sample
This error occurs when NSE doesn't have the app's bundle identifier prefixed to it (Reference post).
In my case, the bundle ID of the app is com.example.sample and the bundle ID of the extension, com.example.sample.NSESample (checked these values in Project -> Target -> Signing & capabilities -> bundle identifier label). I believe this is as expected. I don't understand this error now, which says the embedded bundle identifier is null. I cleaned and built the app again..... same error.
According to this stackoverflow post, you have to enable 'Copy only when installing'. When I tried, it worked. I don't know what this setting means and how this solves the issue. I'm unable to find any documentation reg this setting. Idk if this is even a valid solution, because the error says 'Embedded Binary Bundle Identifier' is null.
Why is the embedded bundle identifier null (despite the Xcode interface showing a valid bundle ID)? How can I solve this?
Post not yet marked as solved
Firebase JS SDK require Notification check so we are added. But its not working in iOS and iPad.
Version: 17.3.1
Working MacOS Safari 17.3.1
Post not yet marked as solved
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?