Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 188.8.131.52 release ready!
Notification Content Extension is an extension to your app which provides a custom interface to your notification in the notification center.
Content extensions provide a great user experience because they’re integrated with the notification center and it runs in a process independent of the main process. However, it is mandatory for the main application to receive feedback when displaying the content extension. In this blog, we will discuss how to create a content extension.
Create a Content Extension:
Add a Notification Content Extension target to your application by selecting File -> New -> Target, and then selecting the Notification Content Extension icon in the Application Extension section as follow:
Notification Content Extension
The extension that is created contains a NotificationViewController that adheres to the UNNotificationContentExtension.
If a UIViewController inside a Notification Content Extension adheres to the UNNotificationContentExtension, we are able to access the notification content and we can customize its UI. In the extension, there’s a MainInterface.storyboard that contains a single controller associated with the NotificationViewController previously mentioned. We can use this storyboard to customize the notification UI using an interface builder.
We can change the UI with the notification contents we receive in func didReceive(_ notification: UNNotification).Your code will look like below:
didReceive(_ notification: UNNotification)
Now we have to go back to our notification content extension and set some attributes in its info.plist. In particular, we have to set:
We’re ready to test our implementation.
That’s all for Notification Content App Extension on iOS. Let’s start to test them in your app. To read more of my blogs, please visit this link. Thank you for reading this blog.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.