[問題] ios5 push notification center一問
各位前輩好:
小弟最近初嚐 ios 的 push notification 設計
以目前而言,不僅 Server 端,與 iphone/ipad端的溝通
都很正常,也可以正確收到推播通知的訊息
但是在進一步測試發現了一個"現象" ios5 的 Notification Center
不知是否小弟觀念有錯,所以特地上來請教各大前輩, 謝謝
以下狀況:
當App開啓時收到Notification時,會觸發
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
所以當然可以正常動作接收的程序
而App沒有開啓時,收到訊息
狀況一:
Notification是以 Alert的方式出現,有Close 與 View兩按鈕可以點擊
而點擊View,則會啓動App並且在didFinishLaunchingWithOptions內
以以下的方式接收
UILocalNotification *remoteNotification = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
if (remoteNotification) {
NSDictionary *userInfo = [launchOptions valueForKey:@"UIApplicationLaunchOptionsRemoteNotificationKey"];
.......
}
狀況二:
Notification是以"橫幅"的方式出現,但是使用者並沒有拉下Notification Center
去點擊通知的訊息,而是直接去開啓程式APP
若是第二種狀況的話,則無論是 UIApplicationLaunchOptionsRemoteNotificationKey
或者 didReceiveRemoteNotification 都不會被觸發...?
請問各位前輩,如何製作才能在"尚未點擊"NotificationCenter內的通知前,
開啟程式APP時,可以直接將這些通知讀入,並且讓這些訊息狀況為已讀?
請各位齊備不吝惜指導...謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.32.160.157
推
04/12 16:23, , 1F
04/12 16:23, 1F
→
04/12 16:24, , 2F
04/12 16:24, 2F
→
04/12 16:25, , 3F
04/12 16:25, 3F
→
04/12 16:27, , 4F
04/12 16:27, 4F
→
04/12 17:24, , 5F
04/12 17:24, 5F
→
04/12 17:25, , 6F
04/12 17:25, 6F
→
04/12 17:26, , 7F
04/12 17:26, 7F
推
04/13 00:19, , 8F
04/13 00:19, 8F
→
04/13 00:20, , 9F
04/13 00:20, 9F
→
04/13 00:23, , 10F
04/13 00:23, 10F
→
04/13 10:02, , 11F
04/13 10:02, 11F
→
04/13 10:02, , 12F
04/13 10:02, 12F
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章