Prerequisites

Before integrating the MobilePush SDK, ensure you complete the essential steps listed in this article to properly set up and configure your environment.

To test and verify your implementation thoroughly, ensure that you and your Marketing Cloud Engagement admin have admin access to MobilePush and all related functionality.

  1. To manage user permissions in Engagement, navigate to Setup > Administration > Users.
  2. Select a user and click Manage Roles > Edit Permissions.
  3. Navigate to the MobilePush section of the permissions tree. To grant access, select all of the checkboxes under General, Message, and Reporting. These permissions are required to set up your app, send messages, and review analytics.
  4. Navigate to the Contact Builder section of the permissions tree. Ensure that you have permission to access and view all contacts in Contact Builder. These permissions are required to test and verify registration information that is sent from the SDK and to review the MobilePush data model before sending attributes from the SDK.
  5. To test and verify messages in Journey Builder, such as in-app messages, navigate to the Journey Builder section of the permissions tree. Select all of the checkboxes under General and Automation.
  6. To create, test, and verify Inbox messages, navigate to the CloudPages category of the permissions tree. Select all of the checkboxes under General.

Ask your marketing admin to create an app in MobilePush, or create it yourself.

  1. In Engagement, navigate to Mobile Studio > MobilePush.
  2. Select Administration. If you don’t see this option, your user doesn’t have permission to administer MobilePush.
  3. Click Create New App and complete the workflow. Create an app on MobilePush

Ask your marketing admin to locate the following required SDK configuration data on your app’s administration page in MobilePush, or locate the information yourself.

To connect your app to your Engagement account, add the four required configuration data from MobilePush to your SDK config file.

  • App ID

  • Access token

  • App endpoint

    Retrieve Access Token, App ID, and App endpoint

  • MID

    Retrieve MID

Provisioning with Firebase Cloud Messaging facilitates the delivery of push messages to users of your app. To retrieve the Firebase config file for your app and add it to Engagement, follow these steps.

  1. Log in to Firebase.

  2. Select an existing project or create a project for your app in the Firebase console.

  3. Navigate to Cloud Messaging under Project Settings. Make note of the Sender ID for your project.

  4. Navigate to Service accounts under Project Settings.

  5. Generate a Server Key by clicking Generate new private key, and then clicking Generate key.

  6. Securely store the JSON file containing the key.

  7. Upload the Server Key JSON file in the Android Sending section of MobilePush's Administration page, as shown in the following image.

    Upload Firebase Config

    If you don't have access to the MobilePush Administration page, contact your marketing admin.

  8. Provide the Firebase Project ID as the Sender ID to the SDK during initialization via setSenderId.

Provisioning your app with Apple ensures that your users receive push messages from your app. Apple provides the following two ways to provision push messaging for your apps.

The first step in provisioning your apps for push messaging is to retrieve the .p8 key or .p12 certificate for your app. After you retrieve the key or certificate, you must provide this information to Engagement.

Apple recommends using authentication keys to provision for push messaging rather than authentication certificates. Therefore, if you're provisioning your app for push messaging for the first time, use the recommended approach of creating an authentication key.

Apple's .p8 authentication keys are newer and more secure as they use JSON Web Tokens (JWT) to authenticate requests, rather than certificates and private keys. To create a .p8 authentication key, follow these steps.

  1. Log in to your Apple Developer Account.

  2. Under Certificates, Identifiers & Profiles, select Keys from the sidebar.

  3. Click the + button in the upper-left corner to add a key.

  4. Under Key Name, enter a unique name for the key.

  5. Select the checkbox next to the Apple Push Notification service, and then click Continue.

  6. Review the key configuration and then click Confirm.

  7. Click Download to generate and download the key.

The key is saved as a text file with a .p8 file extension in your downloads folder. MobilePush requires this key to communicate with Apple.

Store this authentication key in a private and secure location. Since this key isn't saved in your Apple Developer account, you can't download it again.

You don't have to generate environment-specific .p8 keys. Apple uses the same key to send push notifications to apps, regardless of the environment.

We recommend using .p8 authentication keys over .p12 authentication certificates. If you must use .p12 certificates in your implementation and have an existing certificate, renew it and then add it to Engagement.

To create or renew a .p12 authentication certificate, follow these steps.

  1. Create an app ID by logging in to your Apple Developer account and navigating to Certificates, Identifiers & Profiles > Identifiers.

  2. Click the + button and enter an App Identifier name.

  3. Enable Push notifications for the App Identifier.

    If you're renewing a .p12 certificate or your app already has an existing App ID or Provisioning Profile, you can skip this step.

  4. Request a certificate from a Certificate Authority through the Keychain Access app and select the Save to Disk option.

    If you're renewing a .p12 certificate, you can skip this step.

  5. Proceed to Certificates and create a certificate by clicking the + button.

  6. Under Services, choose Apple Push Notification service SSL (Sandbox & Production) and click Continue.

    This certificate is valid for both Sandbox and Production environments, eliminating the need for separate keys.

  7. Select the App ID for which to enable push notification services.

  8. Upload the CertificateSigningRequest file generated in step 4.

    Upon completion, the certificate is created with a .cer extension. Export this certificate as a .p12 file using the Keychain Access app.

  9. Add the .p12 file under Sending Services in Engagement's Administration page.

If you run into trouble while configuring the authentication key or certificate, see Apple Push Notification Service Server Configuration for troubleshooting guidance.