Setting up Badges for Flutter
This guide describes the process of implementing Badges for Pushwoosh Flutter plugin
1. Open your iOS project located in your_project/ios/Runner.xcworkspace and create NotificationServiceExtension:
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2Ffiles.gitbook.com%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LZcP-aO1PEwwePSSaCB-1260461824%252Fuploads%252FXRE70uxm1OIpbzmaDwdc%252FScreenshot%25202022-03-29%2520at%252016.36.38.png%3Falt%3Dmedia%26token%3D93bbba00-207e-4c63-bb9b-009024b3ba0b&width=768&dpr=4&quality=100&sign=dc48af1e&sv=1)
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2F800539163-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LZcP-aO1PEwwePSSaCB-1260461824%252Fuploads%252FGsnjxHNxgeKcJkAYXjVt%252FScreenshot%25202022-03-29%2520at%252016.39.00.png%3Falt%3Dmedia%26token%3D0467b63d-5dd1-46c1-9c86-529d7e60330d&width=768&dpr=4&quality=100&sign=26f091a1&sv=1)
2. Open Podfile (located in your_project/ios/Podfile) and add PushwooshXCFramework dependency fo NotificationServiceExtensionTarget:
You can put these lines after target ‘Runner’ do
like in the example below:
3. Install pods via Terminal:
4. Close and reopen your Xcode project.
Make sure that you open the project via .xcworkspace and not via .xcproject.
5. Make sure that your Deployment target matches the one in the Runner target; otherwise, you might face an issue when building your app (e.g., if you specify iOS 10.0 in Runner and iOS 15.5 in NotificationService targets).
6. Add App Groups capability to both Runner and NotificationService targets and add a new group with the same name for both targets:
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2F800539163-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LZcP-aO1PEwwePSSaCB-1260461824%252Fuploads%252F4dBQDnfSRLauBfETdox1%252FScreenshot%25202022-03-29%2520at%252017.05.55.png%3Falt%3Dmedia%26token%3D6c5453a0-89be-4302-9482-6625e1aed3a9&width=768&dpr=4&quality=100&sign=c004129a&sv=1)
![](https://docs.pushwoosh.com/~gitbook/image?url=https%3A%2F%2F800539163-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252F-LZcP-aO1PEwwePSSaCB-1260461824%252Fuploads%252FU7VOH3S3EZZc8CuTC446%252FScreenshot%25202022-03-31%2520at%252014.14.02.png%3Falt%3Dmedia%26token%3D2b7d3fcd-6059-4ee6-ac56-67f6d1cb1f2e&width=768&dpr=4&quality=100&sign=6c58b28c&sv=1)
7. Add PW_APP_GROUPS_NAME info.plist flag to both Runner and NotificationService targets with the group name as its string value:
8. Go to NotificationService.m and replace its code with the following:
That's it!
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.
Last updated