> ## 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 8.x.x) When Notification Content Extension is Not Implemented?

> Fix iOS push template issues (carousel, colors, fonts) on SDK 8.x.x by implementing a Notification Content Extension for your MoEngage project.

## Problem

Push templates (carousel images, background color, font color, and so on) do not display 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/edOesIUir9gj8Ram/images/moengage_381db3.png?fit=max&auto=format&n=edOesIUir9gj8Ram&q=85&s=712c76135c22ac28c296483a48dee4d3" alt="NCE.png" width="1454" height="1040" data-path="images/moengage_381db3.png" />

* *Name the Extension Target.* Choose a name for the extension target. **Swift** is recommended as the language as it works seamlessly with Objective-C projects too.
  <img alt="name swift.png" src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/KsJki5a8yMg6ntlX/images/moengage_6dbf7c.png?fit=max&auto=format&n=KsJki5a8yMg6ntlX&q=85&s=fb51d6fee5e28cdae94ce760cfb2f092" width="1412" height="1016" data-path="images/moengage_6dbf7c.png" />
* Add the **AppGroupId** to the Notification Content Extension’s **Signing & Capabilities** settings. <img alt="signing.png" src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/Iezim28Dq9VwdHEg/images/moengage_cfae58.png?fit=max&auto=format&n=Iezim28Dq9VwdHEg&q=85&s=3f4597fb16de4782e0b4ab2302dbfb59" width="2560" height="836" data-path="images/moengage_cfae58.png" />
* Set the minimum deployment iOS version of the Notification Content Extension to match the main app’s iOS version.
  <img alt="deployment.png" src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/VkgGMsGmJgjZHMEB/images/moengage_1c1516.png?fit=max&auto=format&n=VkgGMsGmJgjZHMEB&q=85&s=721b0aad28a582e3adeb966fd53893ba" width="1920" height="455" data-path="images/moengage_1c1516.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 'MoEngageRichNotification'
     end
     target 'MoegageRichContent" do
       use_frameworks! #use use_frameworks only if included in main target as in above scenario
       pod 'MoEngageRichNotification'
     end
     ```
3. Code changes in **NotificationViewController.swift** file.
   ```swift Swift theme={null}
   import UIKit
   import UserNotifications
   import UserNotificationsUI
   import MoEngageRichNotification
   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, *) {
               MORichNotification.addPushTemplate(toController: self, withNotification: 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 alt="main.png" src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/KsJki5a8yMg6ntlX/images/moengage_6c5271.png?fit=max&auto=format&n=KsJki5a8yMg6ntlX&q=85&s=516a867a60d0d102e09a8b4761f89d43" width="3360" height="1646" data-path="images/moengage_6c5271.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/rPOWpSCf-19U620Q/images/moengage_8c6d4d.png?fit=max&auto=format&n=rPOWpSCf-19U620Q&q=85&s=bb23d4ac094a514d6e0507ab105579fa" alt="NSExtension.png" width="1948" height="786" data-path="images/moengage_8c6d4d.png" />
6. *Check Build Phases in Main App Target.*
   * In Embed App Extensions/Embed Foundation Extensions, ensure that **Copy only when installing** is not selected.
     <img alt="copy only.png" src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/ek1Vn7ZU0if8mZjx/images/moengage_241f44.png?fit=max&auto=format&n=ek1Vn7ZU0if8mZjx&q=85&s=da9a9fd1030b7059d872f16466e22ae0" width="2740" height="930" data-path="images/moengage_241f44.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 running or archiving the project, make sure that the Build Configuration for the Main Target, Notification Service Extension, and Notification Content Extension Target points to the same scheme/configuration.
     <img src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/ZzjBq42wE6KCuCD8/images/moengage_e1336f.png?fit=max&auto=format&n=ZzjBq42wE6KCuCD8&q=85&s=ff6d1d637d3ce6448412ead8b9613fcc" alt="debug.png" width="1750" height="556" data-path="images/moengage_e1336f.png" />

   <img src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/0lMa3ompHczMJAIn/images/moengage_585502.png?fit=max&auto=format&n=0lMa3ompHczMJAIn&q=85&s=d9a709d7396deff5aa56ab85c8c6ee14" alt="target.png" width="1832" height="446" data-path="images/moengage_585502.png" />

   <img src="https://mintcdn.com/moengage-doc-2315-external-css-font-urls/T6MGMUL7gZwC4R32/images/moengage_2f8b4e.png?fit=max&auto=format&n=T6MGMUL7gZwC4R32&q=85&s=12f62277d0558e3409a900c40c79b9a3" alt="duplicate.png" width="1826" height="976" data-path="images/moengage_2f8b4e.png" />
