20 #include <TargetConditionals.h>
21 #import <Foundation/Foundation.h>
28 Class notificationClass = NSClassFromString(
@"NSUserNotificationCenter");
29 if(notificationClass) {
35 void send_cocoa_notification(
const std::string& owner,
const std::string& message);
37 #pragma clang diagnostic push
38 #pragma clang diagnostic ignored "-Wunused-parameter"
41 Class appleNotificationClass = NSClassFromString(
@"NSUserNotificationCenter");
42 if (appleNotificationClass) {
43 send_cocoa_notification(owner, message);
47 #pragma clang diagnostic pop
49 void send_cocoa_notification(
const std::string& owner,
const std::string& message) {
50 NSString *title = [NSString stringWithCString:owner.c_str() encoding:NSUTF8StringEncoding];
51 NSString *description = [NSString stringWithCString:
message.c_str() encoding:NSUTF8StringEncoding];
57 [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification:
notification];
void send_notification(const std::string &owner, const std::string &message, const desktop::notifications::type note_type)
@ notification
Callbacks with a sender aka notification messages.
struct utils::detail::formula_initer init