→ uranusjr:無法 06/27 13:19
→ pigcat1315:提示樣式 選無 有辦法偵測嗎? 06/27 14:21
[UIApplication sharedApplication].enabledRemoteNotificationTypes
typedef enum : NSUInteger {
UIRemoteNotificationTypeNone = 0,
UIRemoteNotificationTypeBadge = 1 << 0,
UIRemoteNotificationTypeSound = 1 << 1,
UIRemoteNotificationTypeAlert = 1 << 2,
UIRemoteNotificationTypeNewsstandContentAvailability = 1 << 3
} UIRemoteNotificationType;
文件 http://d.pr/Dh8R
要注意這是把 disply style, badge 和 sound 合併處理(先不管 newsstand)
所以提示樣式選擇無只會造成 UIRemoteNotificationTypeAlert 這個 bit 被設成 0
而不見得會回傳 UIRemoteNotificationTypeNone
所以你要用 if (types & UIRemoteNotificationTypeAlert) 這樣判斷
然後我要道德勸說一下
通知關閉是使用者的決定, 沒有人會沒事把原本打開的東西特地進去關掉
這種暗示使用者做錯事情的訊息感覺不太尊重對方
請永遠假設使用者很懶惰, 但不要把他們當笨蛋
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.94.57
※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1403851089.A.6C4.html
※ 編輯: uranusjr (140.112.94.57), 06/27/2014 14:43:59
推 pigcat1315:主要是怕使用者安裝第一次安裝~選否收不到 06/27 14:47
推 pigcat1315:謝謝回答~原來我忽略這篇 06/27 14:58
→ mraaa:你講到重點了,第一次選否就否啦!使用者需要,他自己會再開 06/27 22:11
→ mraaa:! 06/27 22:11
→ mraaa:每次你都要提示會很煩!就已經選否了=.= 06/27 22:12
推 drag:我遇到的是使用者第一次安裝選否之後,回頭報bug 07/02 15:34
→ drag:說push notification沒有動作,後來才發現自己關掉了...=,= 07/02 15:35