Setting up badges for Unity
Since the Unity plugin does not contain the PWNotificationExtensionManager header, you have to perform several additional steps to implement Badges for your Unity project.
1. Add Notification Service Extension (File -> New -> TargetâŠ)
Section titled â1. Add Notification Service Extension (File -> New -> TargetâŠ)â
2. Select the âNotification Service Extensionâ
Section titled â2. Select the âNotification Service Extensionââ
3. Add Pushwoosh.xcframework to NotificationService extension target as follows:
Section titled â3. Add Pushwoosh.xcframework to NotificationService extension target as follows:â- Choose NotificationService extension target.
- Go to the âGeneralâ tab.
- Find âFramework and Librariesâ and press â+â button.
- Select Pushwoosh.xcframework.


4. Update the Notification Service Extension code as follows:
Section titled â4. Update the Notification Service Extension code as follows:â#import "NotificationService.h"#import "PWNotificationExtensionManager.h"
@interface NotificationService ()
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@end
@implementation NotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler { self.contentHandler = contentHandler; self.bestAttemptContent = [request.content mutableCopy];
[[PWNotificationExtensionManager sharedManager] handleNotificationRequest:request contentHandler:contentHandler];}
- (void)serviceExtensionTimeWillExpire { // 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. self.contentHandler(self.bestAttemptContent);}
@end
5. Add the âApp Groups Capabilityâ for each target of your application
Section titled â5. Add the âApp Groups Capabilityâ for each target of your applicationâ


6. Add the App Groups ID to your info.plist for each target of your application
Section titled â6. Add the App Groups ID to your info.plist for each target of your applicationâ<key>PW_APP_GROUPS_NAME</key><string>group.com.example.demoapp_example</string>
Share your feedback with us
Section titled âShare your feedback with usâ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.