notification method

  1. @override
Future<void> notification({
  1. required String notid,
  2. required String appToken,
})
override

Implementation

@override
Future<void> notification({
  required String notid,
  required String appToken,
}) async {
  final notificationRequest = NotificationRequest(
    notificationRequest: Notification(
      appToken: appToken,
      id: notid,
      notid: notid,
    ),
  );
  final payload = notificationRequestToJson(notificationRequest);
  final resp = await http.post(
    Uri.parse(AppConstants.baseUrl + '/notification/'),
    headers: {
      'Content-Type': 'application/json; charset=UTF-8',
      if (keyAuthorization.isNotEmpty)
        'Authorization': 'key=$keyAuthorization'
    },
    body: payload,
  );
  if (resp.statusCode != 200) {
    debugPrint(
      'Unfortunately it was not possible confirm notification',
    );
  }
  return;
}