old_contents: from plyer.facades import Notification
  import Foundation
  import objc
  import AppKit
  
  
  class OSXNotification(Notification):
      def _notify(self, **kwargs):
          NSUserNotification = objc.lookUpClass('NSUserNotification')
          NSUserNotificationCenter = objc.lookUpClass('NSUserNotificationCenter')
          notification = NSUserNotification.alloc().init()
          notification.setTitle_(kwargs.get('title').encode('utf-8'))
          #notification.setSubtitle_(str(subtitle))
          notification.setInformativeText_(kwargs.get('message').encode('utf-8'))
          notification.setSoundName_("NSUserNotificationDefaultSoundName")
          #notification.setHasActionButton_(False)
          #notification.setOtherButtonTitle_("View")
          #notification.setUserInfo_({"action":"open_url", "value":url})
          NSUserNotificationCenter.defaultUserNotificationCenter() \
                              .setDelegate_(self)
          NSUserNotificationCenter.defaultUserNotificationCenter() \
                              .scheduleNotification_(notification)
  
  
  def instance():
      return OSXNotification()
  
  
new_contents: from plyer.facades import Notification
  from pyobjus import autoclass, protocol, objc_str, ObjcBOOL
  from pyobjus.dylib_manager import load_framework, INCLUDE
  
  load_framework(INCLUDE.AppKit)
  load_framework(INCLUDE.Foundation)
  
  NSUserNotification = autoclass('NSUserNotification')
  NSUserNotificationCenter = autoclass('NSUserNotificationCenter')
  
  
  class OSXNotification(Notification):
      def _notify(self, **kwargs):
          title = kwargs.get('title', '')
          message = kwargs.get('message', '')
          app_name = kwargs.get('app_name', '')
          # app_icon, timeout, ticker are not supported (yet)
  
          notification = NSUserNotification.alloc().init()
          notification.setTitle_(objc_str(title))
          notification.setSubtitle_(objc_str(app_name))
          notification.setInformativeText_(objc_str(message))
  
          userNotificationCenter = NSUserNotificationCenter.defaultUserNotificationCenter()
          userNotificationCenter.setDelegate_(self)
          userNotificationCenter.deliverNotification_(notification)
  
      @protocol('NSUserNotificationCenterDelegate')
      def userNotificationCenter_shouldPresentNotification_(self, center, notification):
          return ObjcBOOL(True)
  
  
  def instance():
      return OSXNotification()
  
subject: rewrite notification on mac using pyobjus