Reputation: 107
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. 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?
Upvotes: 2
Views: 9652
Reputation: 2061
Yes, you need to create the separate certificates (dev and release) for Notification Service Extension.
Also you should include the mutable-content key and set true in your payload as shown below.
{
"aps": {
"alert": {
"title": "test title",
"body": "test message"
},
"mutable-content": 1
},
and more...
}
Upvotes: 0
Reputation: 239
Yes you have to use separate provisioning profile for Notification Service Extension and Notification Content Extension. For reference you can use this link.
https://mobisoftinfotech.com/resources/mguide/ios-10-rich-notifications-tutorial/
Service extensions:
A Service extension’s entry point class UNNotificationServiceExtension
It overrides 2 methods:
func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
}
func serviceExtensionTimeWillExpire() {
}
Content extension’s entry point class is UIViewController and it implements protocol
func didReceive(_ notification: UNNotification) {
}
Upvotes: 2