confirmDelivered method
Implementation
Future<bool> confirmDelivered(String token, String messageId) async {
var result = true;
var basicAuth = "Basic ${base64.encode(utf8.encode('$token:$messageId'))}";
try {
await http
.post(
Uri.parse('https://pub.pushed.ru/v1/confirm?transportKind=Apns'),
headers: {
"Content-Type": "application/json",
"Authorization": basicAuth
},
body: "")
.timeout(const Duration(seconds: 10),
onTimeout: (() => throw Exception("TimeOut")));
} catch (e) {
result = false;
}
return (result);
}