generateNativeOfflinePushInfoByDart static method

Map<String, dynamic>? generateNativeOfflinePushInfoByDart(
  1. OfflinePushInfo? info
)

Implementation

static Map<String, dynamic>? generateNativeOfflinePushInfoByDart(OfflinePushInfo? info) {
  if (info == null) {
    return null;
  }
  return Map<String, dynamic>.from({
    "offline_push_config_desc": info.desc,
    "offline_push_config_ext": info.ext,
    "offline_push_config_flag": info.disablePush == null
        ? 0
        : info.disablePush == true
            ? 1
            : 0,
    "offline_push_config_ios_config": Map<String, dynamic>.from({
      "ios_offline_push_config_title": info.title,
      "ios_offline_push_config_sound": info.iOSSound,
      "ios_offline_push_config_ignore_badge": info.ignoreIOSBadge,
      "ios_offline_push_config_push_type": info.iOSPushType,
    }),
    "offline_push_config_android_config": Map<String, dynamic>.from({
      "android_offline_push_config_title": info.title,
      "android_offline_push_config_sound": info.androidSound,
      "android_offline_push_config_notify_mode": 1,
      "android_offline_push_config_vivo_classification": info.androidVIVOClassification!,
      "android_offline_push_config_oppo_channel_id": info.androidOPPOChannelID,
      "android_offline_push_config_xiaomi_channel_id": info.androidXiaoMiChannelID,
      "android_offline_push_config_fcm_channel_id": info.androidFCMChannelID,
      "android_offline_push_config_huawei_category": info.androidHuaWeiCategory,
    })
  });
}