NUIPushNotification constructor

NUIPushNotification({
  1. String? header,
  2. String? body,
  3. String? smallIcon,
  4. String? largeIcon,
  5. String? launchUrl,
  6. NUIPushMeta? meta,
  7. Map<String, dynamic>? data,
  8. OSNotification? osNotification,
})

Implementation

NUIPushNotification({
  this.header,
  this.body,
  this.smallIcon,
  this.largeIcon,
  this.launchUrl,
  this.meta,
  this.data,
  OSNotification? osNotification
}){
  if(osNotification != null){
    header = osNotification.title ?? "";
    body = osNotification.body ?? "";
    smallIcon = osNotification.smallIcon;
    largeIcon = osNotification.largeIcon;
    launchUrl = osNotification.launchUrl;
    data = osNotification.additionalData ?? Map();

    // get iStudio metadata
    if(osNotification.additionalData?.containsKey("meta") == true){
      final meta = osNotification.additionalData!["meta"];
      this.meta = NUIPushMeta();
      this.meta?.type = meta.optString("type");
      this.meta?.recipientId = meta.optString("recipientId");
      this.meta?.actionType = meta.optString("actionType");
    }
  }
}