Place User Notifications behind a feature flag, as the framework technically requires code signing

This commit is contained in:
Ryan McGrath 2020-03-16 22:08:12 -07:00
parent 5884d267c9
commit 79bb456b93
No known key found for this signature in database
GPG key ID: 811674B62B666830
3 changed files with 9 additions and 0 deletions

View file

@ -19,4 +19,5 @@ uuid = { version = "0.8", features = ["v4"] }
url = "2.1.1"
[features]
user-notifications = []
enable-webview-downloading = []

View file

@ -7,6 +7,8 @@ fn main() {
if std::env::var("TARGET").unwrap().contains("-apple") {
println!("cargo:rustc-link-lib=framework=Security");
println!("cargo:rustc-link-lib=framework=WebKit");
#[cfg(feature = "user-notifications")]
println!("cargo:rustc-link-lib=framework=UserNotifications");
}
}

View file

@ -34,7 +34,10 @@ pub mod geometry;
pub mod layout;
pub mod menu;
pub mod networking;
#[cfg(feature = "user-notifications")]
pub mod notifications;
pub mod pasteboard;
pub mod printing;
pub mod toolbar;
@ -53,7 +56,10 @@ pub mod prelude {
pub use crate::layout::LayoutConstraint;
pub use crate::menu::{Menu, MenuItem};
#[cfg(feature = "user-notifications")]
pub use crate::notifications::{Notification, NotificationCenter, NotificationAuthOption};
pub use crate::toolbar::{Toolbar, ToolbarController, ToolbarHandle};
pub use crate::networking::URLRequest;