iOS本地推送

來源:互聯網
上載者:User

標籤:c   a   int   使用   資料   cti   

iOS的本地通知服務需要使用NSLocalNotification,處理基於時間行為的通知。比如定時通知使用者該學習了。
使用NSLocalNotification一般需要考慮三個方面:
scheduled time:時間周期,用來指定iOS系統發送通知的日期和時間;
notification type:通知類型(包括警告資訊,動作按鈕的標題,應用表徵圖上的badge(數字標記)和播放的聲音);
自訂資料,本地通知可以包含一個dictionary類型的本機資料。
對本地通知的數量限制,iOS最多允許最近本地通知數量是64個,超過限制的本地通知將被iOS忽略。
使用樣本:
UILocalNotification *notification=[[UILocalNotification alloc] init];
NSDate *now=[NSDate new];
notification.fireDate=[now addTimeInterval:100];
notification.timeZone=[NSTimeZone defaultTimeZone];
[email protected]"提醒你該學習IOS了";
[[UIApplication sharedApplication]   scheduleLocalNotification:notification];

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.