In Build Phases tab of your project, open Link Binaries With Libraries and click on Add items ("+" button). Search for and add libz.tbd and libc++.tbd libraries to your project:
Add Required Capabilities
Select the root project (1), your main app target (2), and "Signing and Capabilities" tab.
Press the "+ Capability" butt on (3) and select the "Push Notifications" capability.
Then, add the "Background Modes" capability and check the "Remote notifications" check box (4).
4. Well done! Xcode capabilities configuration completed.
XCODE 13 Time Sensitive notifications
If you want to send Time Sensitive notifications add Time Sensitive notifications capability (read more about time sensitive push notifications here).
Add iOS Message Delivery Tracking
There is an API method in Pushwoosh that tracks the delivery of push notifications. iOS apps do not support this method out of the box as push notifications in iOS are handled by the OS, not by Pushwoosh SDK. However, you can implement delivery tracking by adding the Pushwoosh Notification Service Extension for push delivery tracking to your project. Here you'll find the steps to implement Message Delivery Tracking for iOS apps.
Available on iOS 10.0 and later
1. Add Notification Service Extension
1.1. In Xcode, Select File > New > Target...
1.2. Select Notification Service Extension andpress Next.
1.3 Enter the product name and press Finish.
Do not select Activate on the dialog that is shown after pressing Finish.
Press Cancel on the Activate scheme prompt.
By canceling, you are keeping Xcode debugging your app, instead of the extension you just created. If you activated it by accident, you can switch back to debug your app within Xcode.
2. Add code for tracking message delivery events
2.1 Add the following code to your NotificationService.m file:
importUserNotificationsimportPushwooshclassNotificationService:UNNotificationServiceExtension {var contentHandler: ((UNNotificationContent) ->Void)?var bestAttemptContent: UNMutableNotificationContent? override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
// Pushwoosh ********** PWNotificationExtensionManager.shared().handle(request, contentHandler: contentHandler)// ******************** self.contentHandler = contentHandler bestAttemptContent = (request.content.mutableCopy()as? UNMutableNotificationContent)iflet bestAttemptContent = bestAttemptContent {// Modify the notification content here... bestAttemptContent.title ="\(bestAttemptContent.title) [modified]"contentHandler(bestAttemptContent) } }overridefuncserviceExtensionTimeWillExpire() {// Called just before the extension will be terminated by the system. // Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
iflet contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {contentHandler(bestAttemptContent) } }}
Your feedback helps us create a better experience, so we would love to hear from you if you have any issues during the SDK integration process. If you face any difficulties, please do not hesitate to share your thoughts with us via this form.