I try to receive remote notifications in widgets(implemented through WidgetKit), but failed.
It known that enable remote notifications should register first by calling
UIApplication.shared.registerForRemoteNotifications()
but in widget cannot calling shared, it is available in widgets
@property(class, nonatomic, readonly) UIApplication *sharedApplication NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.");
and if try to init a UIApplication(by UIApplication()), the app will crash for more than one UIApplication instance.