How to Avoid Push Template Issues in iOS Push Notifications When Notification Content Extension is Implemented?

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 implemented.

Instruction

Verify the following steps:

  1. The Info.plist of the Notification Content Extension should look like this:
    Swift
    <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>
  2. Select MainInterface.storyboard in the Content extension, remove the default label, and set the background color of the View to clear.main interface.png
  3. Check Build Phases in Main App Target. 
    • In Embed App Extensions/Embed Foundation Extensions, ensure that Copy only when installing is not selected.copy install.png
  4. 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.
  5. 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.debug.pngtarget.pngduplicate.png

              

Was this article helpful?
0 out of 0 found this helpful

How can we improve this article?