Post

Replies

Boosts

Views

Created

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
1k
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
433
Dec ’21
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") } } } } }
Replies
1
Boosts
0
Views
1k
Activity
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.
Replies
0
Boosts
0
Views
433
Activity
Dec ’21
How to delete the widget of the app launched from Xcode on MacOS
The widget of the ipados-app launched from Xcode on MacOS does not disappear from Notification Center. How can I delete it?
Replies
0
Boosts
0
Views
384
Activity
Nov ’21