1
0
Fork 0
forked from lthn/blockchain
blockchain/src/gui/qt-daemon/application/notification_helper.mm
2018-12-27 18:50:45 +03:00

14 lines
596 B
Text

#include "notification_helper.h"
#include <Foundation/NSString.h>
#include <Foundation/NSUserNotification.h>
void notification_helper::show(const std::string& title, const std::string& message)
{
NSUserNotification *userNotification = [[[NSUserNotification alloc] init] autorelease];
userNotification.title = [NSString stringWithUTF8String:title.c_str()];
userNotification.informativeText = [NSString stringWithUTF8String:message.c_str()];
NSUserNotificationCenter* center = [NSUserNotificationCenter defaultUserNotificationCenter];
[center deliverNotification:userNotification];
}