Call `NCWidgetController().setHasContent(_:forWidgetWithBundleIdentifier:)` from main bundle
import UIKit
import SafariServices
+import NotificationCenter
/// The application's delegate.
@objc public class AppDelegate: UIResponder, UIApplicationDelegate {
@@ -87,6 +88,11 @@ import SafariServices
} catch {
print(error.localizedDescription)
}
+
+ if let bundleID = Bundle.main.bundleIdentifier?.appending(".Today-Widget"), let dir = FileManager.default.sharedDirectory?.path {
+ let scriptExists = FileManager.default.fileExists(atPath: (dir as NSString).appendingPathComponent("main.py"))
+ NCWidgetController().setHasContent(scriptExists, forWidgetWithBundleIdentifier: bundleID)
+ }
}
#endif
