iOS 的通知分為遠端推送與本地通知。UILocalNotification 適合在裝置本地排程提醒。
建立 UILocalNotification 後,可設定 fireDate、timeZone、repeatInterval、alertBody 與 soundName。若要攜帶參數,可設定 userInfo。
使用 scheduleLocalNotification: 可將通知加入排程。當 App 正在執行且收到通知時,可由 AppDelegate 的 didReceiveLocalNotification: 處理。
若要取消指定通知,可使用 cancelLocalNotification:;若要取消全部本地通知,可使用 cancelAllLocalNotification。