> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-doc-2298-s2s-type-case-sensitive.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-doc-2298-s2s-type-case-sensitive/a2l6wkMC7lufPKpI/images/moengage_71e025.png?fit=max&auto=format&n=a2l6wkMC7lufPKpI&q=85&s=cae9007d12476fa541c80c8b50741215" 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-doc-2298-s2s-type-case-sensitive/2juJZAT1rO-n85t1/images/moengage_35e6b6.png?fit=max&auto=format&n=2juJZAT1rO-n85t1&q=85&s=d309e9b4af86a60b228bd44979043f36" 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-doc-2298-s2s-type-case-sensitive/jA5_Tv0-ZOquSl0e/images/moengage_ac6bfb.png?fit=max&auto=format&n=jA5_Tv0-ZOquSl0e&q=85&s=4702ca480d84e686791923445c7db365" 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-doc-2298-s2s-type-case-sensitive/Rs6MNSgJTu1-kPs5/images/moengage_5c1797.png?fit=max&auto=format&n=Rs6MNSgJTu1-kPs5&q=85&s=cc70bfdbca6f024747a80bc30c2a3396" 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-doc-2298-s2s-type-case-sensitive/ci8Djcf_YLqDkdsJ/images/moengage_771662.png?fit=max&auto=format&n=ci8Djcf_YLqDkdsJ&q=85&s=a88b93048833a147dce19efa539823b5" 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-doc-2298-s2s-type-case-sensitive/eN8TTpbzCRE-EZce/images/moengage_054a69.png?fit=max&auto=format&n=eN8TTpbzCRE-EZce&q=85&s=82859778442643033e1f2882224da096" 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-doc-2298-s2s-type-case-sensitive/A81yfpx0UFQbaH75/images/moengage_968bdb.png?fit=max&auto=format&n=A81yfpx0UFQbaH75&q=85&s=9086fe98b090afe29928ee477bb67651" 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-doc-2298-s2s-type-case-sensitive/-y-IRwI6U1wYhebG/images/moengage_62d0a0.png?fit=max&auto=format&n=-y-IRwI6U1wYhebG&q=85&s=3c0473e9dc93e14960d6ee72e61e355e" alt="debug.png" width="1750" height="556" data-path="images/moengage_62d0a0.png" />
   <img src="https://mintcdn.com/moengage-doc-2298-s2s-type-case-sensitive/dTBbDtFoMaeihEr8/images/moengage_c31f9e.png?fit=max&auto=format&n=dTBbDtFoMaeihEr8&q=85&s=853f57093bf0b24ec7e7ac0894f3c3fb" alt="target.png" style={{ width:"94%" }} width="1832" height="446" data-path="images/moengage_c31f9e.png" />
   <img src="https://mintcdn.com/moengage-doc-2298-s2s-type-case-sensitive/r9esWJAG8HqSa0_4/images/moengage_9ee69a.png?fit=max&auto=format&n=r9esWJAG8HqSa0_4&q=85&s=142e47645a9734b2f4e59d5e306f3c7c" alt="duplicate.png" style={{ width:"93%" }} width="1826" height="976" data-path="images/moengage_9ee69a.png" />
