enqueue static method
Enqueues a custom payload for offline-first delivery.
Implementation
static Future<String> enqueue(
JsonMap payload, {
String? type,
String? idempotencyKey,
}) async {
final result = await LocusChannels.methods.invokeMethod('enqueue', {
'payload': payload,
if (type != null) 'type': type,
if (idempotencyKey != null) 'idempotencyKey': idempotencyKey,
});
if (result is String && result.isNotEmpty) {
return result;
}
throw PlatformException(
code: 'ENQUEUE_FAILED',
message: 'Native enqueue did not return an id',
details: result,
);
}