Configure the MobilePush SDK Cordova Plugin for Android Apps

After you install and configure the MobilePush SDK Cordova plugin, configure the plugin to enable push support for the Android platform.

Before you configure the MobilePush SDK Cordova plugin for Android apps, make sure that the plugin is installed and configured for your app. See Marketing Cloud Cordova Plugin.

At the command line, run these commands to install Cocoapods and update the repository.

Apple requires all third-party frameworks to include a privacy manifest. The MobilePush SDK version 8.1.2 and later feature a signed framework and a privacy manifest that meet this requirement. To ensure compatibility with the privacy manifest in SDK versions 8.1.2 and later, your app must support a deployment target of iOS 12 or later. To update the deployment target, complete these steps.

Completing these steps removes support for iOS 11.0 and earlier.

  1. Open the config.xml file for your app in an editor.

  2. Update the deployment-target to include this code.

  3. At the command line, run this command to remove and then add the iOS platform.

Rich notifications include images, videos, titles and subtitles from Marketing Cloud. Rich notifications can include personalization in the title, subtitle, or body of your message. To enable rich notifications, follow these steps.

  1. In Xcode, click File > New > Target.
  2. Select Notification Service Extension.
  3. Name and save the new extension.

Perform these steps every time you add the platform to your Cordova app.

This service extension checks for a "_mediaUrl" element in request.content.userInfo. If it’s present, the extension attempts to download media from the URL, creates a thumbnail-size version, and then adds the attachment. Additionally, the service extension also checks for a "_mediaAlt" element in request.content.userInfo. If this key is found, the service extension uses the element for the body text, in case there are any problems downloading or creating the media attachment.

A service extension can timeout if it can’t download media. In this example, the service extension delivers the original content but replaces the body text with the value from "_mediaAlt".