iOS開發-進階:開啓Remote notifications

需要在Xcode 中修改應用的 Capabilities 開啓Remote notifications,請參考下圖:

修改通知處理函數

當註冊了Backgroud Modes -> Remote notifications 後,notification 處理函數一律切換到下面函數,後臺推送代碼也在此函數中調用。

- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章