Get message center data
  • 23 Dec 2023
  • 1 Minute to read

    Get message center data


      Article Summary

      This method allows you to retrieve the pushes that you sent to your users in the past 3 months in a defined range and quantity.

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

      Method Signature

      +(void)getMessageCenterDataWithLimit:(int)limit startDate:(NSDate *)startDate endDate:(NSDate *)endDate success:(void (^)(NSArray *messageCenterData))completionBlock;

      Method Examples

        NSDate *today = [NSDate date];
        NSDate *yesterday = [today dateByAddingTimeInterval: -86400.0];
        [Insider getMessageCenterDataWithLimit:20 startDate:yesterday endDate:today success:^(NSArray *messageCenterData) {
              NSLog(@"%@", messageCenterData);
          }];
      let today = Date()
      var oneDayBefore = DateComponents()
      oneDayBefore.setValue(-1, for: .day)
      let yesterday = Calendar.current.date(byAdding: oneDayBefore, to: today)
              
      Insider.getMessageCenterData(withLimit: 20, start: yesterday, end: today) { (messageCenterData) in
          // Handle here
      }
      Your title goes here
      This 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.

      Was this article helpful?

      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses