sendDeleteAck method
Sends a 'deleterequestacklocation' key to delete the originally created key
Implementation
Future<bool> sendDeleteAck(
LocationNotificationModel locationNotificationModel) async {
try {
var atkeyMicrosecondId = locationNotificationModel.key!
.split('requestlocation-')[1]
.split('@')[0];
AtKey atKey;
atKey = newAtKey(
60000,
'deleterequestacklocation-$atkeyMicrosecondId',
locationNotificationModel.receiver,
);
var result = await AtLocationNotificationListener().atClientInstance!.put(
atKey,
LocationNotificationModel.convertLocationNotificationToJson(
locationNotificationModel),
isDedicated: MixedConstants.isDedicated,
);
print('sendDeleteAck $result');
if (result) {
if (MixedConstants.isDedicated) {
await SyncSecondary().callSyncSecondary(SyncOperation.syncSecondary);
}
}
return result;
} catch (e) {
print('sendDeleteAck error $e');
return false;
}
}