Post

Replies

Boosts

Views

Activity

ios17 widget display area problem
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") } } } } }
1
0
825
Sep ’23
delete certain APNs in UNNotificationServiceExtension
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.
0
0
330
Dec ’21