Critical Alert is not triggered when Not connected to Xcode

Hello We have a health app that triggers a critical alert when a vital limit is exceeded. Used to work fine until IOS 18 update. Now, after the update, critical alert is triggered correctly when connected to Xcode. However, when disconnected from Xcode, nothing happens. Please help

Nothing happens as in you don't get the critical sound, or don't get any notification at all?

Are the critical alerts being triggered by local notifications or push notifications?

If via push notifications, please share the apns-id of a push notification that was sent but didn't show up.

If it is via local notifications, have you checked whether the local notification is being scheduled at all, or are they failing to be scheduled perhaps due to a different code path in your debug (aka Xcode) builds?


Argun Tekant /  DTS Engineer / Core Technologies

No Sound and No Notifications. Critical Alert triggered by Push Notification. When connected to Xcode the Critical Alert triggers with sound and notification. Please help in finding apns-id when not connected to Xcode. Thanks

apns-id is either set by your push server, or it is returned to your push server as a response to your push request.

If I had to guess without more info and further investigation, I would suggest to check if you are using the incorrect push token for when the app is installed from Xcode vs a release build. Perhaps you are using the same token you use for both cases.

Development or Production tokens can only be used in the environments they belong in. The environment a token belongs to is determined by the "aps-environment" entitlement. By default, Xcode will set this to 'development' for debug builds, and 'production' for release builds. So, if you install the app via Xcode, you will get a development token, and if the app is installed from the App Store, you will get a production token.

You will need to make sure that the push is being sent on the environment the token belongs in. And the correct token received from the correct version of the app is being used to send pushes.


Argun Tekant /  DTS Engineer / Core Technologies

Hello I probably encountered a similar problem when sending a push notification, but it is delivered to the device without sound and screen unlocking. Previously (about 2-3 months ago) it was delivered with sound and screen unlocking. I tried all sorts of variations of iPhone settings for notifications (turned on and off silent mode, display of thumbnails on the locked screen, etc.), none of this helped. ! However, disconnecting the Apple Watch from the phone helped, when they are not connected, the push comes with sound and screen unlocking. What can be done about this?

Critical Alert is not triggered when Not connected to Xcode
 
 
Q