> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-doc-2315-external-css-font-urls.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-2315-external-css-font-urls/4UkzhqPkTH0nSWG3/images/moengage_71e025.png?fit=max&auto=format&n=4UkzhqPkTH0nSWG3&q=85&s=ae99cefe1f6839e440dcd1e01a4ec7df" 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-2315-external-css-font-urls/edOesIUir9gj8Ram/images/moengage_35e6b6.png?fit=max&auto=format&n=edOesIUir9gj8Ram&q=85&s=7cbc44be10b54e3f9281c0a950becaff" 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-2315-external-css-font-urls/7LqjUfWSctG2_W7k/images/moengage_ac6bfb.png?fit=max&auto=format&n=7LqjUfWSctG2_W7k&q=85&s=d02ebad29275c83e380e7ae8cadc2125" 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-2315-external-css-font-urls/f1XCtwZLOBQLUjhw/images/moengage_5c1797.png?fit=max&auto=format&n=f1XCtwZLOBQLUjhw&q=85&s=59b98e0bb89db8a7ff0f43aa79653a97" 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-2315-external-css-font-urls/AeBdxtJ_M_DsQv_B/images/moengage_771662.png?fit=max&auto=format&n=AeBdxtJ_M_DsQv_B&q=85&s=476b1336a51637572530134d834854ef" 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-2315-external-css-font-urls/tb33LKE2EaDqvWEx/images/moengage_054a69.png?fit=max&auto=format&n=tb33LKE2EaDqvWEx&q=85&s=947060985cb71e96876ef5e84353b851" 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-2315-external-css-font-urls/Sj2TdxWgx0jz-aOK/images/moengage_968bdb.png?fit=max&auto=format&n=Sj2TdxWgx0jz-aOK&q=85&s=f4eda2ec6e75f52d34c9cd05345d2075" 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-2315-external-css-font-urls/xC0kXrOGBmx0xNUY/images/moengage_62d0a0.png?fit=max&auto=format&n=xC0kXrOGBmx0xNUY&q=85&s=28a13ab5e7c3d5a89a33ddcbfd626dcb" alt="debug.png" width="1750" height="556" data-path="images/moengage_62d0a0.png" />
   <img src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/yBVRswbrUq_1vjT9/images/moengage_c31f9e.png?fit=max&auto=format&n=yBVRswbrUq_1vjT9&q=85&s=07ccfb52df30da1a3c692f44edd0af22" alt="target.png" style={{ width:"94%" }} width="1832" height="446" data-path="images/moengage_c31f9e.png" />
   <img src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/sPQr3K-d1ig5R-he/images/moengage_9ee69a.png?fit=max&auto=format&n=sPQr3K-d1ig5R-he&q=85&s=a3be85b0739f7272519edd6883f9bfe2" alt="duplicate.png" style={{ width:"93%" }} width="1826" height="976" data-path="images/moengage_9ee69a.png" />
