簡體   English   中英

在 swift 遠程通知中,有沒有辦法在應用程序被殺死時在橫幅中顯示不同於從服務器收到的消息?

[英]In swift remote notification is there a way to display a different message in the banner other than the one received from server when app is killed?

如果我來自服務器的有效負載是

{   "aps" : {  "alert" : "You got a mail";
    "badge" : 0;
}
"user": { "name" : "Nicole" }  }`

它還給了我一些關於發送它的用戶名的其他數據。 有沒有辦法在通知中心或橫幅中以格式顯示自定義消息:“Nicole 已發送郵件”?

iOS 10開始,可以通過創建Notification Service Extension來實現。 您可以查看文檔以了解其詳細信息。 此外,這里是來自 Avanderlee 的一個很好的教程,它解釋了如何將Notification Service Extension添加到您的應用程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM