Loading
Mobile Publisher for Experience Cloud
Test Marketing Cloud Engagement Push Notifications

Test Marketing Cloud Engagement Push Notifications

Test Engagement push notifications by sending them to your branded Mobile Publisher app. You can specify different configurations for production and sandbox. After you set up MobilePush in Engagement, you can enable Engagement push notifications for your Mobile Publisher apps.

Required Editions

Available in: Available in Lightning Experience in: Enterprise, Performance, and Unlimited Editions
User Permissions Needed
To create and modify a Mobile Publisher project: Manage mySalesforce Apps
To create and modify a site: Create and Setup Experiences
Important
Important These instructions are iOS-based. If you want to test push notifications on Android devices, see the Send a test notification message section in Send a test message to a backgrounded app.

This feature requires a Marketing Cloud Engagement license. To enable Engagement for your org, contact your account executive.

Mobile Publisher apps support Engagement push notifications. Engagement push notifications aren’t supported on Publisher Playground apps.

  1. Confirm that the end user is prompted for the push permissions directly after opening the app the first time after installation.
    If you see the push notification prompt, proceed with these steps.
    If you don’t see the push notification prompt, it can mean that the Mobile Publisher Setup UI or MobilePush account has incorrect information. To test, initially disable the Delay until Contact ID or the Delay Push Prompt flag, as these flags can stop the prompt from being seen. For more information about these settings or how to configure them, see Enable Marketing Cloud Engagement Push Notifications for Mobile Publisher Apps. Then proceed with these steps.
  2. Run the Brew Install (Mac Only) library installation tool from a terminal window: brew install openssl
    OpenSSL is available through Brew Install. See Homebrew, and search for OpenSSL.
  3. Copy, paste, and save this code as a shell script.
    #!/bin/bash
    ​
    # To get curl with HTTP/2 and openssl with ECDSA: run 'brew install curl-openssl'
    curl=/usr/bin/curl
    openssl=/usr/bin/openssl
    ​
    # --------------------------------------------------------------------------
    ​
    deviceToken=151512744719aefe525b0a65b820a29789ef5f9bfe394f472d3aa451d6bf905c
    authKey=./MK-MKT-Cloud.p8
    authKeyId=RWZX7Y76UW
    teamId=B83JQ6V4B9
    bundleId=com.mysalesforce.mycommunity.C00D6F000002Jk55UAC.A0OT100000004C93GAE
    endpoint=https://api.push.apple.com
    ​
    read -r -d '' payload <<-'EOF'
    {
      "aps": {
         "badge": 1,
         "alert": {
            "title": "Message from Jitu to Jitu",
            "subtitle": "You see this",
            "body": "Hey Jitu, You seeing this? -- Jitu"
         },
         "_sid": "SFMC"
      }
    }
    EOF
    ​
    # --------------------------------------------------------------------------
    ​
    base64() {
      $openssl base64 -e -A | tr -- '+/' '-_' | tr -d =
    }
    ​
    sign() {
      printf "$1"| $openssl dgst -binary -sha256 -sign "$authKey" | base64
    }
    ​
    time=$(date +%s)
    header=$(printf '{ "alg": "ES256", "kid": "%s" }' "$authKeyId" | base64)
    claims=$(printf '{ "iss": "%s", "iat": %d }' "$teamId" "$time" | base64)
    jwt="$header.$claims.$(sign $header.$claims)"
    ​
    $curl --verbose \
      --header "content-type: application/json" \
      --header "authorization: bearer $jwt" \
      --header "apns-topic: $bundleId" \
      --data "$payload" \
      $endpoint/3/device/$deviceToken
    
  4. Update your saved script with these required values.
    Required Values
    Field NameDescription
    authKey Local file location, for example, /Users/useralias/Downloads/{filename}.p8
    bundleId Located in AppStore Connect | App Information.
    teamId Related to Apple Developer Account | Membership Details.
  5. Run the script from a Mac terminal window.
  6. If you receive the push notification on the Mobile Publisher app from the script, verify the push notification that's set up on Automation Studio/Journey Builder. It’s possible that you didn’t select the correct Contact Audience, such as contactkey, deviceId, and so on.
    If you don’t receive a push notification, there’s an issue in the Mobile Publisher Setup UI in Engagement. Verify the Engagement parameters set up on the Mobile Publisher Setup UI. Correct any errors that you find, and resubmit the app.
 
Loading
Salesforce Help | Article