getNotifications method

dynamic getNotifications(
  1. dynamic config,
  2. num after,
  3. num? before
)

Implementation

getNotifications(dynamic config, num after, num? before) async {
  final date = utcNow();
  String fullRoute =
      "/fetch/?subscriber_id=${config["subscriberId"]}&after=$after&distinct_id=${config["distinctId"]}";
  if (before != null) {
    fullRoute += "&before=${before.toString()}";
  }
  final signature = createSignature(
      workspaceSecret: config["workspaceSecret"],
      route: fullRoute,
      date: date,
      method: "GET");
  final urlIs = Uri.parse(config["apiUrl"] + fullRoute);
  final response = await http.get(urlIs, headers: {
    "Authorization": "${config["workspaceKey"]}:$signature",
    'x-amz-date': date,
  });
  return response;
}