[英]Provisioning profiles for Service Extension and Content Extension
I am trying to implement Rich notifications in my iOS application and while using Notification Service Extension and Notification Content Extension , post running my app I am getting error of same bundle identifier.我正在尝试在我的 iOS 应用程序中实现丰富的通知,并且在使用Notification Service Extension和Notification Content Extension 时,在运行我的应用程序后我收到相同包标识符的错误。 For these extensions do I need to use separate provisioning profiles?
对于这些扩展,我是否需要使用单独的配置文件? Like one for my code, one for Notification Service Extension and one for Notification Content Extension?
比如我的代码,一个是通知服务扩展,一个是通知内容扩展?
Yes you have to use separate provisioning profile for Notification Service Extension and Notification Content Extension . 是的,您必须为Notification Service Extension和Notification Content Extension使用单独的供应配置文件。 For reference you can use this link.
作为参考,您可以使用此链接。
https://mobisoftinfotech.com/resources/mguide/ios-10-rich-notifications-tutorial/
https://mobisoftinfotech.com/resources/mguide/ios-10-rich-notifications-tutorial/
Service extensions: 服务扩展:
A Service extension's entry point class UNNotificationServiceExtension 服务扩展的入口点类UNNotificationServiceExtension
It overrides 2 methods: 它覆盖了2种方法:
func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
}
func serviceExtensionTimeWillExpire() {
}
Content extension's entry point class is UIViewController and it implements protocol 内容扩展的入口点类是UIViewController,它实现协议
func didReceive(_ notification: UNNotification) {
}
Yes, you need to create the separate certificates (dev and release) for Notification Service Extension .是的,您需要为Notification Service Extension创建单独的证书(开发和发布)。
Also you should include the mutable-content key and set true in your payload as shown below.此外,您应该包含可变内容键并在您的负载中设置为true ,如下所示。
{
"aps": {
"alert": {
"title": "test title",
"body": "test message"
},
"mutable-content": 1
},
and more...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.