Using Carousel/Slider and Thumbnail Push
This SDK is developed using the Swift programming language. Unlike our existing iOS SDK, we provide integration support with Swift Package Manager (SPM). You can take advantage of Swift's expressive and intuitive nature, enabling you to create sophisticated applications with ease.
Step 1
Create a new Notification Content Extension to your application. In order to do that, follow these steps:
On Xcode click File -> New -> Target and choose Notification Content Extension.
New class named
NotificationViewController
will be created. It should be extended fromNetmeraNotificationContentExtension
class.
Your NotificationContent
class should look like the following:
After that enable App Groups from the Capabilities for both of your application and NotificationContent extension.
Add
bundle_identifier.group_name
to your app groups.
Step 2
Step 3
After creating the Netmera-Config.plist
, you need to select all three targets in the Target Membership section on the right side.
Step 4
Under your Content Extension, you should select both the Main Project and the Content Extension in the Target Membership section for NotificationViewController
.
Step 5
If you want to allow your application to receive http media contents follow these steps:
Click
Info.plist
underNotificationContentExtension
Add App Transport Security Settings.
Under App Transport Security Settings add Allow Arbitrary Loads and set it YES.
If you want to add slide to Carousel property:
UNNotificationExtensionUserInteractionEnabled
must be set YES.
Add
UNNotificationExtensionCategory
as an array to theinfo.plist
items, and includeNetmeraGeneral
andNetmeraCarousel
.
When adding UNNotificationExtensionCategory
as an array in the info.plist
, please note that this field will not appear automatically and is not selectable from the standard options. You will need to manually enter and configure this field within the info.plist
file.
Here’s a formatted example of the info.plist
source code for implementing a carousel in the notification extension in NSExtensionAttributes
:
If You Use Podfile
In your pod file, you should add NetmeraNotificationContentExtension
and install to your extension target like this. You should complete all the steps from 1-5 if you are using Podfile for your integration.
Default label in MainInterface should be deleted.
Troubleshooting
If you're still unable to successfully view the push notification after following the above steps, check the following:
For the target of the extension, go to Build Settings > Runpath Search Paths and ensure the following paths are added:
Last updated