> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-analytics-query-api-docs.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-analytics-query-api-docs/eJTcJrF1-vmsOukF/images/moengage_71e025.png?fit=max&auto=format&n=eJTcJrF1-vmsOukF&q=85&s=09c819c9f4087eecaced19dac0c70f09" 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-analytics-query-api-docs/DPmJojzt83dkElsC/images/moengage_35e6b6.png?fit=max&auto=format&n=DPmJojzt83dkElsC&q=85&s=b88dfd18aacc10a3272cdd7b4acd055e" 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-analytics-query-api-docs/LWEH9kfXItHS8cCf/images/moengage_ac6bfb.png?fit=max&auto=format&n=LWEH9kfXItHS8cCf&q=85&s=84e3d978cb524746daa24977719d4be8" 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-analytics-query-api-docs/hWQJFSyoPH_i3a3D/images/moengage_5c1797.png?fit=max&auto=format&n=hWQJFSyoPH_i3a3D&q=85&s=1e61c4b691ec3c66c07005d1748881ba" 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-analytics-query-api-docs/wmiIN-H-PtSrzLh0/images/moengage_771662.png?fit=max&auto=format&n=wmiIN-H-PtSrzLh0&q=85&s=8357decc0fe86202122ea246e959c7f9" 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-analytics-query-api-docs/sk5g7KvtTTukvUrB/images/moengage_054a69.png?fit=max&auto=format&n=sk5g7KvtTTukvUrB&q=85&s=cd5cdd1b297bb833c71ab9a853b206c1" 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-analytics-query-api-docs/bQNodCx4rVX2jftR/images/moengage_968bdb.png?fit=max&auto=format&n=bQNodCx4rVX2jftR&q=85&s=51ac35e8942e573d1d97cbcf293bdb69" 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-analytics-query-api-docs/-pkfGoVejWypw2ZS/images/moengage_62d0a0.png?fit=max&auto=format&n=-pkfGoVejWypw2ZS&q=85&s=08e065f6fe01b71847a323efb83d5b0a" alt="debug.png" width="1750" height="556" data-path="images/moengage_62d0a0.png" />
   <img src="https://mintcdn.com/moengage-analytics-query-api-docs/Y31ab75R1bS4e0sI/images/moengage_c31f9e.png?fit=max&auto=format&n=Y31ab75R1bS4e0sI&q=85&s=9e562581c21428147fd0072790562084" alt="target.png" style={{ width:"94%" }} width="1832" height="446" data-path="images/moengage_c31f9e.png" />
   <img src="https://mintcdn.com/moengage-analytics-query-api-docs/bTYZJ6v64OanjGYX/images/moengage_9ee69a.png?fit=max&auto=format&n=bTYZJ6v64OanjGYX&q=85&s=c7d00edb96a3f6376dd25aba8b19f2fa" alt="duplicate.png" style={{ width:"93%" }} width="1826" height="976" data-path="images/moengage_9ee69a.png" />
