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

चूंकि React Native प्लगइन में `PWNotificationExtensionManager` हेडर नहीं होता है, इसलिए आपको अपने React Native प्रोजेक्ट के लिए बैज लागू करने के लिए कई अतिरिक्त कदम उठाने होंगे।


<Aside type="note">
iOS नेटिव ऐप के लिए बैज लागू करने के लिए, कृपया [बैज सेट अप करना](/hi/developer/pushwoosh-sdk/ios-sdk/setting-up-badges/) गाइड देखें।
</Aside>

#### 1. नोटिफिकेशन सर्विस एक्सटेंशन जोड़ें (File -> New -> Target...)

<img src="/shared-7.webp" alt=""/>

#### 2. "Notification Service Extension" चुनें

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

#### 3. नोटिफिकेशन सर्विस एक्सटेंशन कोड को इस प्रकार अपडेट करें:

```
#import "NotificationService.h"
#import <Pushwoosh/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
```

<Aside type="note">
लाइन `#import "NotificationService.h"` में उपयोग किए गए एक्सटेंशन के नाम को अपने एक्सटेंशन के नाम से बदलें।
</Aside>

#### 4. डिपेंडेंसी को एक टारगेट से लिंक करें

React Native मैन्युअल रूप से बनाए गए टारगेट से सभी आवश्यक डिपेंडेंसी को स्वचालित रूप से लिंक नहीं करता है, इसलिए आपको टारगेट के **Build Phases** को अपडेट करना चाहिए और आवश्यक जानकारी प्रदान करनी चाहिए:

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

बस **Compile Sources** और **Link Binary With Libraries** के तहत **+** चिह्न पर क्लिक करें और आवश्यक libs/frameworks खोजें।

#### 5. Xcode में दोनों टारगेट में **App Groups** क्षमता जोड़ें और **ऐप और एक्सटेंशन दोनों के लिए** एक ही ग्रुप सेट करें:

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

#### 6. **दोनों** टारगेट के info.plists में **PW\_APP\_GROUPS\_NAME** कुंजी जोड़ें। मान आपके ऐप ग्रुप का नाम है:

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