Carousel, Slider and Thumbnail Push
Step 1: Create a New Notification Content Extension
To create a new Notification Content Extension to your application:
On Xcode click File > New > Target and choose Notification Content Extension.
New class named
NotificationViewController
will be created. It should be extended fromNetmeraNotificationContentExtension
class. YourNotificationContent
class should look like the following:
Enable Capabilities > App Groups for both your application and
NotificationContent
extension.Add
bundle_identifier.group_name
to your app groups.
Optional: Installing Notification Content Extension Using CocoaPods
If you're using a Podfile for dependency management, follow these steps along with the rest of the steps from 1 to 5:
Install
NetmeraNotificationContentExtension
in your Podfile,Install it to your extension target.
Note: If you're not using CocoaPods, you can skip this step.
Step 2: Add Your AppGroupName
AppGroupName
Add your
AppGroupName
in your Netmera-Config.plist.
Step 3: Select Targets in Target Membership
Select all three targets in the Target Membership section on the right.
Step 4: Select Main Project & Content Extension
Go to Notification View Controller > Target Membership.
Select both the main project and the content extension.
Step 5: Info.plist Settings
Sample Content Extention Info.plist
1. Receiving Http Media Contents
If you want to allow your application to receive http media contents follow these steps:
Click
Info.plist
under Notification Content Extension,Add App Transport Security Settings,
Add Allow Arbitrary Loads under App Transport Security Settings and set it to YES.
2. Enabling Slides in Carousel Notifications
To allow users to slide between multiple media items (such as images) in a notification:
Set
UNNotificationExtensionUserInteractionEnabled
to YES.Add
UNNotificationExtensionCategory
as an array in Info.plist and include:NetmeraGeneral
NetmeraCarousel
(enables sliding between multiple media items)
The UNNotificationExtensionCategory
field does not appear automatically in Info.plist. You must manually enter and configure it.
Troubleshooting
If push notifications do not display correctly:
Go to Build Settings > Runpath Search Paths in the extension target. Ensure the following paths are added:
Remove the default label in MainInterface.
Last updated
Was this helpful?