首页 文章

swift 3本地通知:如何更改每个通知的显示文本

提问于
浏览
3

我知道如何制作一个在特定时间触发每一天的本地通知 . 但是如何为每个通知更改UNMutableNotificationContent.Body?

现在它只是一遍又一遍地显示相同的文本 .

我正在为iOS 10编写代码 .

1 回答

  • 0

    你试过这个吗?

    let content = UNMutableNotificationContent()
    content.title = self.notificationTitle // You could set this variable to anything you like
    content.body = self.notificationBody // You could set this variable to anything you like
    content.sound = UNNotificationSound.default()
    

相关问题