I also have the same issue
Post
Replies
Boosts
Views
Activity
@AmiBSC did you find a solution?
@ericliang I tried the following, as you suggested, but the outcome is the same as with the initial code for iOS 15/16;
VStack {
VStack {
Text("some text")
Text("more text")
}
// wrapper 1
.accessibilityElement(children: .contain)
.accessibilityIdentifier("ID 1111111111111")
}
// wrapper 2
.accessibilityElement(children: .contain)
.accessibilityIdentifier("ID 2222222222222")
@dipak10112 - https://developer.apple.com/forums/profile/dipak10112 Did you set the apns-push-type header field to alert when you send the notification to the APNS server?
But can the user kill an app? how can I kill the app?
@Claude31
My intention is to keep the badge number(the red circle with the number that appears in the right upper corner of the app icon when you have something new waiting for you) in sync with the number of notifications displayed in Notification Center.
For example: if on Notification Center there are 5 notifications then I want the badge to say 5, if the user removes 2, I want the badge number to say 3.
Regarding the Stackoverflow question, I am familiar with the "solution" described there. There it describes how you can find out if a single notification is cleared. I ran the code and is working, so when the user clears out a notification I can decrease the badge by 1.
So far so good, but my problem is when the user clears all notifications at once, then instead of userNotificationCenter getting called multiple times for each notifiication, it is not called at all, and this is my problem because I don't know how to set badge to 0 when the user takes this action.