您现在的位置: IOS教程網 >> IOS系統 >  >> iOS 訊息 >> iOS 相關資訊

iOS UILocalNotification 本地定時通知

編輯:iOS 相關資訊

iOS 的通知分為遠端推送與本地通知。UILocalNotification 適合在裝置本地排程提醒。

建立通知

建立 UILocalNotification 後,可設定 fireDate、timeZone、repeatInterval、alertBody 與 soundName。若要攜帶參數,可設定 userInfo。

排程與接收

使用 scheduleLocalNotification: 可將通知加入排程。當 App 正在執行且收到通知時,可由 AppDelegate 的 didReceiveLocalNotification: 處理。

取消通知

若要取消指定通知,可使用 cancelLocalNotification:;若要取消全部本地通知,可使用 cancelAllLocalNotification。

  1. 上一篇文章:
  2. 下一篇文章:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © IOS教程網 All Rights Reserved