3

我目前正在制作一个向用户显示通知的应用程序,但它不显示应用程序图标。

这是我的代码:

func showNotification(message:String, title:String = "App Name") -> Void {
    let notification = NSUserNotification()
    notification.title = title
    notification.informativeText = message
    NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification(notification)
}

showNotification("\(song)\n\(artist)",title: "Now Playing")

如何将我的应用程序图标添加到通知中?

编辑:

这是我的应用程序图标资产:

在此处输入图像描述

这是我的通知。

在此处输入图像描述

4

0 回答 0