toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  var json = {
    "app_token": appToken,
    "identifier": identifier,
    "registration": registration,
    "platform": platform,
    "sdk": sdk,
    "device_model": deviceModel,
    "device_manufacturer": deviceManufacturer,
    "os_locale": osLocale,
    "os_language": osLanguage,
    "os_version": osVersion,
    "app_version": appVersion,
    "app_installed_in": appInstalledIn!.toIso8601String(),
    "app_updated_in": appUpdatedIn!.toIso8601String(),
    "uuid": uuid,
    "attribution_id": attributionId,
    "custom_field": customField,
    "phone": phoneNumber,
    "email": email,
    "lat": lat,
    "long": long,
  };
  if (Platform.isIOS) {
    json["idfa"] = idfa;
  } else {
    json["advertiser_id"] = advertiserId;
  }
  return json;
}