offLinePushConfig2Dart static method
OfflinePushInfo
offLinePushConfig2Dart(
- dynamic jsonPushInfo
Implementation
static OfflinePushInfo offLinePushConfig2Dart(jsonPushInfo) {
// late String? title;
// late int? androidVIVOClassification = 1;
// late String? androidSound;
// String? androidFCMChannelID;
// String? androidXiaoMiChannelID;
// int? iOSPushType = 0; // 1 is voip
// String? androidHuaWeiCategory;
Map<String, dynamic> iospushconfig = Map<String, dynamic>.from(jsonPushInfo["offline_push_config_ios_config"] ?? {});
Map<String, dynamic> androidpushconfig = Map<String, dynamic>.from(jsonPushInfo["offline_push_config_android_config"] ?? {});
return OfflinePushInfo.fromJson({
"title": iospushconfig["android_offline_push_config_title"] ?? iospushconfig["ios_offline_push_config_title"],
"desc": jsonPushInfo["offline_push_config_desc"],
"ext": jsonPushInfo["offline_push_config_ext"],
"disablePush": jsonPushInfo["offline_push_config_flag"] == 0 ? false : true,
"iOSSound": iospushconfig["ios_offline_push_config_sound"],
"iOSPushType": iospushconfig["ios_offline_push_config_push_type"],
"ignoreIOSBadge": iospushconfig["ios_offline_push_config_ignore_badge"],
"androidOPPOChannelID": androidpushconfig["android_offline_push_config_oppo_channel_id"],
"androidVIVOClassification": androidpushconfig["android_offline_push_config_vivo_classification"],
"androidSound": androidpushconfig["android_offline_push_config_sound"],
"androidFCMChannelID": androidpushconfig["android_offline_push_config_fcm_channel_id"],
"androidXiaoMiChannelID": androidpushconfig["android_offline_push_config_xiaomi_channel_id"],
"androidHuaWeiCategory": androidpushconfig["android_offline_push_config_huawei_category"],
});
}