[問題] 關閉remote notification sounds

看板MacDev作者時間10年前 (2014/09/18 11:44), 編輯推噓2(205)
留言7則, 5人參與, 最新討論串1/1
各位大大 想請教是否有辦法 在app中讓使用者能夠去開關notificaiton的聲音 主要是讓該app在背景時收到notification能夠以使用者的設定去 決定要不要有音效的產生。 嘗試過的情況 1. 我如果設定以下的code,在背景時還是會有音效產生 [[UIApplication sharedApplication] registerForRemoteNotificationTypes: UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeBadge]; 2. 多加UIRemoteNotificationTypeSound,在setting中的Notification Center 該 app會多一欄Sounds可以swith,關掉就後收到notification就不會有聲音了 但還是希望讓使用者可以不用到setting中,直接在app裡可以開關背景時收到notification 的音效 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.61.97.145 ※ 文章網址: http://www.ptt.cc/bbs/MacDev/M.1411011895.A.CB5.html

09/18 11:50, , 1F
無法
09/18 11:50, 1F

09/18 13:20, , 2F
sound不要帶不就不會有聲音了?
09/18 13:20, 2F

09/18 13:20, , 3F
就做一個開關讓使用者switch之後回傳到server
09/18 13:20, 3F

09/18 13:20, , 4F
發push的時候簡單判斷一下看要不要帶sound參數?
09/18 13:20, 4F

09/18 13:38, , 5F
關鍵字 silent notification ios
09/18 13:38, 5F

09/18 16:46, , 6F
請問有不用透過server來設定的方式嗎? 謝謝
09/18 16:46, 6F

09/19 17:26, , 7F
方法1:iOS8似乎不能用了,今天有遇到
09/19 17:26, 7F
文章代碼(AID): #1K6bKtor (MacDev)
文章代碼(AID): #1K6bKtor (MacDev)