> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-deprecated-versions-all-platforms.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Avoid Push Template Issues in iOS Push Notifications (SDK version 7.x.x) Without a Notification Content Extension?

> Fix iOS push template display issues (carousel, colors, fonts) on SDK 7.x.x by creating a Notification Content Extension. Full setup guide included.

## Problem

Push templates (carousel images, background color, font color, and so on) are not displayed correctly in Push notifications when the Notification Content Extension is not implemented.

## Instruction

Perform the following steps:

1. Create a Notification Content Extension target.
   <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/bHs4kGb3ZcErlJ9w/images/moengage_71e025.png?fit=max&auto=format&n=bHs4kGb3ZcErlJ9w&q=85&s=8132e136e32410c487ec1b49cca89db9" alt="NCE.png" width="1454" height="1040" data-path="images/moengage_71e025.png" />
   * In the **Product Name** box, type a name for the extension target.
   * In the **Language** list, click a language. **Swift** is recommended as the language because it works seamlessly with Objective-C projects.
     <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/EwOHXdMkMazUDLiI/images/moengage_35e6b6.png?fit=max&auto=format&n=EwOHXdMkMazUDLiI&q=85&s=4371e7e1f0e4934d1014fccfe9957655" alt="name swift.png" width="1412" height="1016" data-path="images/moengage_35e6b6.png" />
   * On the **Signing & Capabilities** tab, add the *AppGroupId* to the Notification Content Extension’s settings.
     <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/SUHneVVPXn8RBZoX/images/moengage_ac6bfb.png?fit=max&auto=format&n=SUHneVVPXn8RBZoX&q=85&s=fece80a32fce9d52d54ce52858554500" alt="signing.png" width="2560" height="836" data-path="images/moengage_ac6bfb.png" />
   * Under **Minimum Deployments**, set the minimum deployment iOS version of the Notification Content Extension to match the main app’s iOS version.
     <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/YACXnvy_9H54XAQo/images/moengage_5c1797.png?fit=max&auto=format&n=YACXnvy_9H54XAQo&q=85&s=42a27eb988b3e5028caeb5ef52498e00" alt="deployment.png" width="1920" height="455" data-path="images/moengage_5c1797.png" />
2. Integrate the MORichNotification framework into the Notification Content Extension target.
   * In your podfile, add the Notification Content Extension as a separate target and install the MORichNotification framework.
     ```swift Swift theme={null}
     target 'MoEngageDemo' do
       use_frameworks!
       pod 'MoEngage-iOS-SDK'
     end
     target 'MoEngageNotificationService' do
       use_frameworks! #use use_frameworks only if included in main target as in above scenario
       pod 'MORichNotification'
     end
     target 'MoegageRichContent" do
       use_frameworks! #use use_frameworks only if included in main target as in above scenario
       pod 'MORichNotification'
     end
     ```
3. Code changes in **NotificationViewController.swift** file.
   ```swift Swift theme={null}
   import UIKit
   import UserNotifications
   import UserNotificationsUI
   import MORichNotification
   class NotificationViewController: UIViewController, UNNotificationContentExtension {
       @IBOutlet var label: UILabel?
       
       override func viewDidLoad() {
           super.viewDidLoad()
           MORichNotification.setAppGroupID("group.com.XXXXXXXXXXXXXXXX")
       }
       
       func didReceive(_ notification: UNNotification) {
           if #available(iOSApplicationExtension 12.0, *) {
               MOPushTemplateHandler.sharedInstance().addPushTemplate(to: self, with: notification)
           } else {
               // Fallback on earlier versions
           }
       }
   }
   ```
4. Select **MainInterface.storyboard** in the Content extension, remove the default label, and set the background color of the View to clear.
   <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/q-008Y35fEBRCckJ/images/moengage_771662.png?fit=max&auto=format&n=q-008Y35fEBRCckJ&q=85&s=b1dd277a92ff8d6d46a5a32a5d071f6f" alt="main.png" width="3360" height="1646" data-path="images/moengage_771662.png" />
5. Info.plist changes:
   ```swift Swift theme={null}
   <key>NSExtensionAttributes</key> 
   <dict>
         <key>UNNotificationExtensionCategory</key>
         <string>MOE_PUSH_TEMPLATE</string>
         <key>UNNotificationExtensionDefaultContentHidden</key>
         <true/>
         <key>UNNotificationExtensionInitialContentSizeRatio</key>
         <real>1.2</real>
         <key>UNNotificationExtensionUserInteractionEnabled</key>
         <true/>
   </dict>
   ```
   <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/5uD-PZQAU3XNefcA/images/moengage_054a69.png?fit=max&auto=format&n=5uD-PZQAU3XNefcA&q=85&s=ee2a3278cc293acc2a4e0b27876a406f" alt="NSExtension.png" width="1948" height="786" data-path="images/moengage_054a69.png" />
6. Check build phases in the main app target.
   * In Embed App Extensions/Embed Foundation Extensions, clear the **Copy only when installing** check box.
     <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/_EMe6H4jeyVfy_-X/images/moengage_968bdb.png?fit=max&auto=format&n=_EMe6H4jeyVfy_-X&q=85&s=a7ad66dc615eae9062c1595511e6e0a4" alt="copy only.png" width="2740" height="930" data-path="images/moengage_968bdb.png" />
7. Ensure consistent *appGroupId* across configurations.
   * Verify that the *appGroupId* is consistent across all schemes and configurations (for example, Debug/Release/QA/UAT) in the project.
8. Align build configuration.
   * When executing or archiving the project, ensure that the build configuration for the main target, Notification Service Extension, and Notification Content Extension target points to the same scheme or configuration.
     <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/FRe_ugO0fyKP893X/images/moengage_62d0a0.png?fit=max&auto=format&n=FRe_ugO0fyKP893X&q=85&s=b148ab9867c2ba5e99efb6301e082167" alt="debug.png" width="1750" height="556" data-path="images/moengage_62d0a0.png" />
   <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/ccZavoac99kBXael/images/moengage_c31f9e.png?fit=max&auto=format&n=ccZavoac99kBXael&q=85&s=9c1aaf9341d7433b9774194ae8ee7949" alt="target.png" style={{ width:"94%" }} width="1832" height="446" data-path="images/moengage_c31f9e.png" />
   <img src="https://mintcdn.com/moengage-sdk-deprecated-versions-all-platforms/bt8Th_F8uXG1cl8q/images/moengage_9ee69a.png?fit=max&auto=format&n=bt8Th_F8uXG1cl8q&q=85&s=95e2bae327e226bb8e7ca26b61daa79b" alt="duplicate.png" style={{ width:"93%" }} width="1826" height="976" data-path="images/moengage_9ee69a.png" />
