Get message center data

Prev Next

The getMessageCenterData method allows you to retrieve pushes you sent to your users in the past three months, within a specified range and quantity.

ParameterData Type
limitInteger
startDateDate
endDateDate
your title goes here
Make sure you pass the startDate and endDate values as timestamps.

Method Signature

public void getMessageCenterData(int limit, Date startDate, Date endDate, MessageCenterData messageCenterData)

Method Example

Insider.Instance.getMessageCenterData(20, new Date(1546300800), new Date(), new MessageCenterData() {
    @Override
    public void loadMessageCenterData(JSONArray messageCenterData) {
        // Handle here
        Log.d("[INSIDER]", "[getMessageCenterData]: " + messageCenterData);
    }
});

Sample Response

Below is a sample response for this method.

[getMessageCenterData]: [{"camp_id":4423,"camp_type":"Single Push","created_at":"2022-05-18T11:36:47Z","deep_links":{"key":"value"},"message":"My great message","title":"My amazing title","variant_id":9743},{"camp_id":169,"camp_type":"Recurring Push","created_at":"2022-05-17T13:50:12Z","message":"This is another message","title":"This is another title","variant_id":9735},{"camp_id":4352,"camp_type":"Single Push","created_at":"2022-04-18T16:03:34Z","image_url":"https:image.png","message":"This is my message","title":"This is my title","variant_id":9599}]
Your title goes here
The getMessageCenterData method functions with a user-based mechanism. For example, if user A and user B log into the app on the same device, each user will see the push notifications they received.