简体   繁体   English

服务扩展和内容扩展的配置文件

[英]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 ExtensionNotification 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.

相关问题 通知内容扩展是否需要新的配置文件? - Will notification Content extension required new provisioning profile? 通知服务扩展是否需要单独的配置文件? - Does Notification Service Extension require separate provisioning profile? 如何在Notifications服务扩展中预加载Notifications Content扩展的资源 - How to preload resources in Notifications Service extension for Notifications Content extension Xcode 找不到任何与“应用程序扩展包的捆绑 ID”签名问题匹配的 iOS App Store 配置文件 - Xcode couldn't find any iOS App Store provisioning profiles matching 'bundle id for app extension' signing problem 在动态框架中实现通知服务和内容扩展 - Implement Notification Service and Content Extension in Dynamic Framework 是否应为通知服务扩展和通知内容扩展创建单独的APNS证书? - Should I create separate apns certificate for notification Service Extension and notification Content Extension? Swift钥匙串和配置文件 - Swift keychain and provisioning profiles iOS 更新推送内容扩展 - iOS update push in content extension 本地通知的通知服务扩展 - Notification service extension for Local notification UNNotification内容扩展中的打印语句 - Print statements in UNNotification Content Extension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM