【发布时间】:2017-02-02 11:06:23
【问题描述】:
我收到推送通知,如何将其发送到带有徽章的设备? 只是一个简单的,带有文本标题正文徽章。
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
print("Push notification received:")
}
Swift 3 我的环境
【问题讨论】:
我收到推送通知,如何将其发送到带有徽章的设备? 只是一个简单的,带有文本标题正文徽章。
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
print("Push notification received:")
}
Swift 3 我的环境
【问题讨论】:
如果您想在应用程序打开时更新徽章编号,您可以使用applicationIconBadgeNumber。 Documentation here.
如果您希望在应用程序关闭时更新徽章,那么您需要修改发送推送的服务器上的代码以包含徽章编号。
你可以看看答案posted here。
【讨论】: