toMap method

Map<String, dynamic> toMap()

Returns the RemoteMessage as a raw Map.

Implementation

Map<String, dynamic> toMap() {
  Map<String, dynamic> result = <String, dynamic>{
    'pi_pn_senderId': senderId,
    'pi_pn_data': data,
    'pi_pn_from': from,
    'pi_pn_messageId': messageId,
    'pi_pn_messageType': messageType,
    'pi_pn_title': title,
    'pi_pn_body': body,
    'pi_pn_sentTime': sentTime?.millisecondsSinceEpoch,
    'pi_pn_ttl': ttl,
    'pi_pn_targetUrl': data['targetUrl'] ?? "",
    'pi_pn_metaData': data['pi_pn_metaData'],
    'pi_pn_campaignName': "",
    'pi_pn_campaignSource': "",
    'pi_pn_campaignId': ""
  };

  result.addAll(getCampaignDetails());
  return result;
}