GuidesDiscussions
Log In
Guides

Custom Icon

⚠️ This feature is available starting from version 4.28.4 and above. ⚠️

To support custom icons in notifications, follow the steps below:

Enable Communication Notifications:

  • Open your project in Xcode.
  • Go to the Signing & Capabilities tab of your main target.
  • Click + Capability and add Communication Notifications.

Add the following key to your project's Info.plist file

<key>NSUserActivityTypes</key>
<array>
	<string>INSendMessageIntent</string>
</array>

This allows the system to associate your notifications with messaging features.

Update Notification Extension

In your Notification Extension, make sure to include the following method inside the UNNotificationServiceExtension, usually within the didReceive(_:withContentHandler:) method:

DigitalReef.includeMediaAttachment(request: request, mutableContent: bestAttemptContent!, contentHandler: contentHandler)
[DigitalReef includeMediaAttachmentWithRequest:request mutableContent:self.bestAttemptContent contentHandler:self.contentHandler];

This method is responsible for attaching the custom icon and other media resources to the
notification.

Include Media Attachment

If it is not included, the notification will appear without those enhancements.