IOS下推送訊息執行個體教程

來源:互聯網
上載者:User

標籤:沒有   request   更新   cat   apns   產生   子程式   包括   undle   

這幾天在研究apple的通知推送機制,也做了一個簡單的例子程式,還沒有整合到工程中,由於時間關係,先寫個梗 概:

一、通過”鑰匙串訪問”(ketchain Access)產生Certificate Signing Request (CSR);

二、進入iOS Provisioning Portal,建立appid或者更新配製,啟用Enable for Apple Push Notification service 選項,並用CSR產生認證檔案;

三、安裝認證並匯出P12檔案,選中安裝的認證,選擇匯出即可;

四、在開發人員網站產生Appid對應的profile檔案,安裝profile檔案;

五、建立工程,綁定相應的bundle identifier(appleid,注意不含App ID Prefix),並指定剛安裝好的profile檔案,程式包括如下幾個部分;

1. 註冊遠程通知服務

[application registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge |UIRemoteNotific. ationTypeAlert |UIRemoteNotificationTypeSound];

2. 擷取device token,並將device token儲存至通知伺服器;

3. 處理接收到了通知後的事件處理;

六、編寫伺服器端程式

伺服器程式主要有兩個功能:一、儲存device token;二、向APNS推送push通知

IOS下推送訊息執行個體教程

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.