Send Push Notifications from Mixpanel

You can send rich push notifications for iOS and Android with Mixpanel’s push builder. You can customize your notifications with images, buttons, silent notifications, priority settings, and channel targeting. To use all features in the rich push builder, you need to use the latest version of the SDK. For iOS you can view additional steps, including integrating the Notification Service Extension here

Before You Begin

Use the latest version of the Android or iOS SDK to send rich push notifications with Mixpanel’s push builder. Using the latest version of the SDK ensures that you can use all of the features in the push builder. 

If you were previously using Mixpanel’s push builder to send rich push notifications, modify your existing push notifications to ensure that the new SDK behaves as expected with your existing notifications. For example, If you have your own custom extension of Mixpanel's SDK, ensure that the JSON namespace is different. 

Use the SDK versions included in the table below to send rich push notifications without a custom setup:

Mobile SDK

SDK Version

Android

5.7.0+

iOS Swift

2.7.0+

iOS Objective C

3.6.0+

Note: To send rich push notifications with iOS, complete the following additional steps described in this article for Swift and Objective C.

Compose Message

Enter text into the Title and Body fields to add a message title and message body. Both a message title and message body are required. 

You can use liquid templating with push notifications. The Use liquid templating checkbox is selected by default. Click the checkbox to disable liquid templating. 


Media & Interactions

The following optional configurations control how users interact with your notification.

unnamed__5_.png

Image url: Url of the image displayed in the thumbnail and expanded in the notification body. If you upload a different expanded image, the image url will only be displayed in the thumbnail. You can use any link that is publicly available via https. You can override the image url in Advanced when you configure the Thumbnail Image or Expanded Image

On tap behavior: Configure the action that occurs when a user taps a push notification. You can select one of the following options: Open app home screen, Open URL (in browser), or Deep link into app.

Notification Buttons: Configure buttons and decide what happens when a user taps a button. You can configure On tap behavior, Button label, and Button id for each notification button. You can add up to three notification buttons. 

unnamed__4_.png

Silent Notification

A silent notification removes all text, sound, or other media, and wakes up the app. Silent notifications are typically used to check for uninstalls or to pre-load data. Select the checkbox marked Send as a silent notification to enable silent notifications. Enabling silent notifications means the notification will not be displayed on the user’s device. Send as a silent notification is unselected by default. 

Android Advanced Functions 

You can toggle between Sending On and Sending Off under Android Advanced Functions. The toggle is set to Sending On for both Android and iOS by default.

unnamed__3_.png

Message Content

Subtitle: An optional field to add subtitles to your push notification.

Thumbnail image: This is the small image on the right hand side of the push notification in its collapsed state.

Expanded state image: This is the image that is displayed when the push notification is pulled down to reveal the expanded state.

Icon: This is the icon logo on the left of the app name. You can change this by referring to a different resource within your app.

Icon color: You can choose to change the color of your app icon by inserting a hex code.

Delivery Options

Set badge count: Set the badge count for your app. May be displayed as a badge count for launchers that support badging. If zero or unspecified, systems that support badging use the default, which is to increment a number displayed on the long-press menu each time a new notification arrives.

Tag: Overwrite an existing notification. This is useful in messaging applications where you may want to overwrite an existing message with the latest messages in the chat. If not specified, each request creates a new notification. If specified and a notification with the same tag is already being shown, the new notification replaces the existing one in the notification drawer.

Channel ID: Select a channel to send the message in. Your users can specify different rules for different channels. You will need to create a channel in advance in your application and reference them here.

Sticky: Configure if your notification is dismissed when tapped or remains in the tray when a user taps a notification.

Visibility: Change the amount of information that is shown on a lock screen. Selecting Private means that the notification’s icon and ticker text will be visible on the lock screen. The message will be hidden. Selecting Public means that the notification’s icon, ticker text and message will be visible on the lock screen. Selecting Secret means that the notification’s icon, ticker text, and message will be hidden on the lock screen. Default is private. 

Time: Set the time displayed for when the push notification is received on the user’s device. 

TTL: Limits the lifespan of data on your network. 

Priority: Select Normal or High message priority. Normal priority messages are delivered immediately when the app is in the foreground. High priority messages are delivered immediately, allowing the CM service to wake a sleeping device when necessary. 

Custom Data

Key value pairs: Enter key value pairs to merge into the final payload. Any fields with the same name will override values in the final payload. 

Custom JSON: Include any custom JSON key value pairs that you want to pass through to your application to do custom rendering.

iOS Advanced Functions 

You can toggle between Sending On and Sending Off under iOS Advanced Functions. The toggle is set to Sending On for both Android and iOS by default. 

unnamed__3_.png

Message Content

Rich media: Url of an image, video, or sound that is played when the notification is expanded. Rich media overrides the image url value. 

Sound: The name of a sound file in your app’s main bundle, or in the Library or Sounds folder of your app’s data container. This sound plays as the notification alert sound. If the sound file cannot be found, the device plays the default alert sound. 

Delivery Options

Set badge count: Set the badge count for your app. May be displayed as a badge count for launchers that support badging. If zero or unspecified, systems that support badging use the default, which is to increment a number displayed on the long-press menu each time a new notification arrives.

Category: You can name this value one of your app’s registered categories. If you specify the category, it will override the built-in Mixpanel logic for action buttons and dismiss tracking. 

Custom Data

Key value pairs: Enter key value pairs to merge into the final payload. Any fields with the same name will override values in the final payload. 

Custom JSON: Include any custom JSON key value pairs that you want to pass through to your application to do custom rendering.

Preview A Push Notification

You can preview a push notification to see how your notification will appear on a user's device by sending a notification to yourself, or other team members. To send a push notification test, click Preview and enter the user profiles that you would like to receive the test notification.

Screen_Shot_2020-03-16_at_9.38.43_AM.png

Targeting Users

You can target users to receive push notifications using events, properties, and cohorts. A push notification targeting criteria can contain one or more filters. Each filter can contain one or more conditions. For more information about how to configure targeting criteria, see this article

You can use a cohort to send a push notification to a specific group of users. For more information on creating a cohort, see this article

unnamed__1_.png

Delivery Settings

Specify delivery settings for your push notification. You can select ONE-TIME or RECURRING message delivery. Under ONE-TIME, you can select Now or Later date. Under RECURRING, you can select As criteria is met, Daily, Weekly, or Monthly

unnamed.png

Did this answer your question?

Comments

0 comments

Please sign in to leave a comment.