The widget of the ipados-app launched from Xcode on MacOS does not disappear from Notification Center. How can I delete it?
Post
Replies
Boosts
Views
Activity
After receiving APNs and processing within NotificationService: UNNotificationServiceExtension, I want to delete and certain APNs. Is there any good way?
var apnsCollapseId = request.identifier
UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [apnsCollapseId])
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [apnsCollapseId])
doesn't work
UNUserNotificationCenter.current().getPendingNotificationRequests { (requests: [UNNotificationRequest]) in
UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [requests[0].identifier])
}
UNUserNotificationCenter.current().getDeliveredNotifications { (completionHandler: [UNNotification]) in
UNUserNotificationCenter.current().removePendingNotificationRequests(withIdentifiers: [completionHandler[0].request.identifier])
}
also doesn't work.
The returned completionHandler is just nil.
I am having trouble displaying widgets on iOS17.
In iOS16, it can be displayed in the full size of the widget, but in iOS17, it is displayed in an area 16 dots smaller in all direction than the original size.
I would like to have the same display on iOS17 as on iOS16, is there a better way?
struct widgetSmall : View {
var body: some View {
ZStack() {
Rectangle()
.foregroundColor(Color.yellow)
VStack() {
HStack() {
Text("Upper-left")
Spacer()
}
Spacer()
HStack() {
Spacer()
Text("Lower-right")
}
}
}
}
}