notification method
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;
}