getMetaData method
Returns the custom metadata attached to this message in the campaign,
or null if the message carries none.
final metadata = message.getMetaData();
final name = metadata?['name'];
Implementation
Map<String, dynamic>? getMetaData() {
// Android hands over the message's `data` node as is, whereas iOS hands
// over the whole message payload, which keeps that node under `data`.
final inner = data['data'];
final metadata =
data['metadata'] ?? (inner is Map ? inner['metadata'] : null);
return metadata is Map ? Map<String, dynamic>.from(metadata) : null;
}