# Flutter के लिए बैज सेट अप करना

1. अपने iOS प्रोजेक्ट को **your_project/ios/Runner.xcworkspace** में खोलें और **NotificationServiceExtension** बनाएं:

<img src="/flutter-setting-up-badges-for-flutter-1.webp" alt=""/>

<img src="/flutter-setting-up-badges-for-flutter-2.webp" alt=""/>

2. Podfile खोलें (**your_project/ios/Podfile** में स्थित) और NotificationServiceExtensionTarget के लिए **PushwooshXCFramework** डिपेंडेंसी जोड़ें:

```
target ‘NotificationService’ do
  pod ‘PushwooshXCFramework’, ‘>=6.5.0’
end
```

<Aside type="note">
आप इन लाइनों को `target ‘Runner’ do` के बाद रख सकते हैं, जैसा कि नीचे दिए गए उदाहरण में है:

```bash title="Podfile उदाहरण"
target ‘Runner’ do
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end
target ‘NotificationService’ do
  pod ‘PushwooshXCFramework’, ‘>=6.5.0’
end
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end
```
</Aside>

3. Terminal के माध्यम से पॉड्स इंस्टॉल करें:

```
cd ios && pod install
```

4. अपने Xcode प्रोजेक्ट को बंद करें और फिर से खोलें।

<Aside type="caution">
सुनिश्चित करें कि आप प्रोजेक्ट को **.xcworkspace के माध्यम से** खोलें, न कि .xcproject के माध्यम से।
</Aside>

5. सुनिश्चित करें कि आपका **Deployment target, Runner target** से मेल खाता हो; अन्यथा, आपको अपना ऐप बनाते समय किसी समस्या का सामना करना पड़ सकता है (उदाहरण के लिए, यदि आप Runner में iOS 10.0 और NotificationService targets में iOS 15.5 निर्दिष्ट करते हैं)।

6. Runner और NotificationService दोनों टारगेट्स में **App Groups capability** जोड़ें और दोनों टारगेट्स के लिए एक ही नाम का एक नया ग्रुप जोड़ें:

<img src="/flutter-setting-up-badges-for-flutter-3.webp" alt=""/>

<img src="/flutter-setting-up-badges-for-flutter-4.webp" alt=""/>

7. Runner और NotificationService दोनों टारगेट्स में **PW_APP_GROUPS_NAME** info.plist फ्लैग जोड़ें, जिसमें ग्रुप का नाम उसकी स्ट्रिंग वैल्यू के रूप में हो:

<img src="/flutter-setting-up-badges-for-flutter-5.webp" alt=""/>

8. **NotificationService.m** पर जाएं और उसके कोड को निम्नलिखित से बदलें:

```objective-c
#import “NotificationService.h”
#import &#x3C;Pushwoosh/PWNotificationExtensionManager.h>

@interface NotificationService ()
<strong>@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
</strong>@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
```


## हमारे साथ अपनी प्रतिक्रिया साझा करें

आपकी प्रतिक्रिया हमें एक बेहतर अनुभव बनाने में मदद करती है, इसलिए यदि आपको SDK इंटीग्रेशन प्रक्रिया के दौरान कोई समस्या आती है तो हम आपसे सुनना चाहेंगे। यदि आपको कोई कठिनाई आती है, तो कृपया [इस फ़ॉर्म के माध्यम से](https://docs.google.com/forms/d/e/1FAIpQLSd\_0b8jwn-V\_JmoPLIxIFYbHACCQhrzidOZV3ELywoQPXRSxw/viewform) हमारे साथ अपने विचार साझा करने में संकोच न करें।