Android Object Specification

These objects are used to define or request information related to Android Push and Android Push Alert content.

Android Push Object

You must include an Android Push Object in messages if you want users you have targeted to receive a push on their Android devices. The total number of bytes in your alert string and extra object should not exceed 4000. The Messaging API will return an error if you exceed the message size allowed by Google.

Body

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
   "alert": (required, string) the notification message,
   "title": (required, string) the title that appears in the notification drawer,
   "extra": (optional, object) additional keys and values to be sent in the push,
   "message_variation_id": (optional, string) used when providing a campaign_id to specify which message variation this message should be tracked under (must be an Android Push Message),
   "notification_channel_id": (optional, string) the channel ID the notification will be sent with,
   "priority": (optional, integer) the notification priority value,
   "send_to_sync": (optional, if set to true we will throw an error if "alert" or "title" is set),
   "collapse_key": (optional, string) the collapse key for this message,
   // Specifying "default" in the sound field will play the standard notification sound
   "sound": (optional, string) the location of a custom notification sound within the app,
   "custom_uri": (optional, string) a web URL, or Deep Link URI,
   "summary_text": (optional, string),
   "time_to_live": (optional, integer (seconds)),
   "notification_id": (optional, integer),
   "push_icon_image_url": (optional, string) an image URL for the large icon,
   "accent_color": (optional, integer) accent color to be applied by the standard Style templates when presenting this notification, an RGB integer value,
   "send_to_most_recent_device_only": (optional, boolean) defaults to false, if set to true, Braze will only send this push to a user's most recently used Android device, rather than all eligible Android devices,
   "buttons" : (optional, array of Android Push Action Button Objects) push action buttons to display
   "conversation_data" : (optional, Android Conversation Push Object) the data to be displayed via Conversation Push.
}

You can send “Big Picture” notifications by specifying the key appboy_image_url in the extra object. The value for appboy_image_url should be a URL that links to where your image is hosted. Images need to be cropped to a 2:1 aspect ratio and should be at least 600x300. Images used for notifications will only display on devices running Jelly Bean (Android 4.1) or higher.

Additional Parameter Details

Parameter Details
priority This parameter will accept values from -2 to 2, where -2 represents “MIN” priority and 2 represents “MAX”. 0 is the “DEFAULT” value.

Any values sent that outside of that integer range will default to 0. For more information on which priority level to use, please see our section on Android Notification Priority.
collapse_key FCM can simultaneously store only up to 4 collapse keys per device. If you use more than 4 collapse keys, FCM does not make any guarantees as to which ones will be kept. Braze uses one of these by default for campaigns, so make sure to specify only up to 3 additional collapse keys for Android messages.
push_icon_image_url The value for the large icon parameter should be a URL that links to where your image is hosted.

Images need to be cropped to a 1:1 aspect ratio and should be at least 40x40.
notification_channel If this is not specified, Braze will attempt to send the notification payload with the dashboard fallback channel ID. For more information on notification_channel please see our developer documentation and our user guide article on Android Push notification channels.

For more information on send_to_sync messages please see our section on “Silent Android Notifications”.

Android Push Action Button Object

1
2
3
4
5
6
{
  "text": (required, string) the button's text,
  "action": (optional, string) one of "OPEN_APP", "URI", "DEEP_LINK", or "CLOSE", defaults to "OPEN_APP",
  "uri": (optional, string) a web URL or Deep Link URI,
  "use_webview": (optional, boolean) whether to open the web URL inside the app if the action is "URI", defaults to true
}

Android Conversation Push Object {##android-conversation-push-object}

The concepts in this message correspond to those in the Android Conversation Push Documentation.

1
2
3
4
5
6
{
  "shortcut_id" : (required, string) the sharing shortcut identifier,
  "reply_person_id" : (required, string) the identifier of the Person this push is replying to,
  "messages" : (required, array of Android Conversation Push Message Object),
  "persons" : (required, array of Android Conversation Push Person Object)
}

Android Conversation Push Message Object

1
2
3
4
5
{
  "text" : (required, string) the text of this message,
  "timestamp" : (required, integer) the unix timestamp of when this message was sent,
  "person_id" : (required, string) the Person identifier of this message's sender,
}

Android Conversation Push Person Object

1
2
3
4
{
  "id" : (required, string) the identifier of this Person,
  "name" : (required, string) the display name of this Person
}
WAS THIS PAGE HELPFUL?
New Stuff!