【问题标题】:(Swift 3) I need to send a notification to the user to open the app at a specific time. Better to use a local or push notification?(Swift 3)我需要向用户发送通知以在特定时间打开应用程序。更好地使用本地或推送通知?
【发布时间】:2017-09-10 04:36:38
【问题描述】:

我在这里找到了 2 个选项,LocalNotification 或 UNMutableNotification(通过 UserNotifications)。哪两个适合我每天在某个设定时间发送通知的需要?非常感谢任何帮助。

【问题讨论】:

    标签: ios swift xcode swift3 ios10


    【解决方案1】:

    假设您使用的是 iOS 10+,您应该使用 UNNotificationRequest 安排通知,使用 UNTimeIntervalNotificationTrigger 设置触发日期

    根据 Apple 的说法,documentation、UILocalNotification 在 iOS 10 中已被弃用

    【讨论】:

      猜你喜欢
      • 2018-01-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-19
      • 1970-01-01
      相关资源
      最近更新 更多