How to send a ios Push Notification (Azure Notif Hub) with media attachment?

时间:2019-03-19 15:18:49

标签: ios azure apple-push-notifications azure-storage-blobs azure-notificationhub

We have a Web App to compose notification which a user sends a push notification message (Azure Notification Hub) and also can upload PDF/Word as attachment. How should i handle it on the phone side when it receives the notification? Should i save the PDF/Word to Azure Blob Storage when they upload from the Webapp and point to that URL when it receives on the phone end? What is the best way to architect this?

1 个答案:

答案 0 :(得分:0)

您可以发送可选的自定义数据作为推送有效内容的一部分。数据将以键值格式发送。可以通过Push SDK回调在应用程序中拦截这些自定义数据。

很少有可通过自定义数据设置的保留关键字。

https://docs.microsoft.com/en-us/appcenter/sdk/push/ios#custom-data-in-your-notifications

mutable-content:将此键添加为1以启用媒体附件。该应用程序需要支持服务扩展才能下载和处理附件内容。有关更多信息,请参阅Apple文档。