# إعداد الشارات لـ Unity

نظرًا لأن إضافة Unity لا تحتوي على رأس PWNotificationExtensionManager، يجب عليك تنفيذ عدة خطوات إضافية لتطبيق الشارات لمشروع Unity الخاص بك.


<Aside type="note">
لتنفيذ الشارات لتطبيق iOS الأصلي، يرجى الرجوع إلى دليل [إعداد الشارات](/ar/developer/pushwoosh-sdk/ios-sdk/setting-up-badges/).
</Aside>

### 1. أضف Notification Service Extension (File -> New -> Target...)

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

### 2. حدد "Notification Service Extension"

<img src="/cross-platform-frameworks-setting-up-badges-for-unity-1.webp" alt=""/>

### 3. أضف Pushwoosh.xcframework إلى هدف امتداد NotificationService كما يلي:

1. اختر هدف امتداد **NotificationService**.
2. اذهب إلى علامة التبويب "**General**".
3. ابحث عن '**Framework and Libraries**' واضغط على زر '**+**'.
4. حدد **Pushwoosh.xcframework.**



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

### 4. قم بتحديث كود Notification Service Extension كما يلي:

```
#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. أضف "App Groups Capability" لكل هدف في تطبيقك

<img src="/cross-platform-frameworks-setting-up-badges-for-unity-2.webp" alt=""/>

<img src="/cross-platform-frameworks-setting-up-badges-for-unity-3.webp" alt="App Groups Capability"/>

<img src="/cross-platform-frameworks-setting-up-badges-for-unity-4.webp" alt="Info.plist"/>

### 6. أضف App Groups ID إلى info.plist الخاص بك لكل هدف في تطبيقك

```
<key>PW_APP_GROUPS_NAME</key>
<string>group.com.example.demoapp_example</string>
```

## شاركنا ملاحظاتك

تساعدنا ملاحظاتك في إنشاء تجربة أفضل، لذلك نود أن نسمع منك إذا واجهت أي مشاكل أثناء عملية دمج SDK. إذا واجهت أي صعوبات، فلا تتردد في مشاركة أفكارك معنا [عبر هذا النموذج](https://docs.google.com/forms/d/e/1FAIpQLSd\_0b8jwn-V\_JmoPLIxIFYbHACCQhrzidOZV3ELywoQPXRSxw/viewform).