createAndroidChannel method
Future<Map>
createAndroidChannel(
- String id,
- String name,
- int importance,
- String description, {
- String? groupId,
- bool? allowBubbles,
- bool? light,
- int? lightColor,
- bool? showBadge,
- String? soundPath,
- int? soundUsage,
- int? soundContentType,
- int? soundFlag,
- bool? vibration,
- List<
int> ? vibrationPatterns,
override
创建 Android 平台的NotificationChannel
Implementation
@override
Future<Map<dynamic, dynamic>> createAndroidChannel(
String id,
String name,
int importance,
String description, {
String? groupId,
bool? allowBubbles,
bool? light,
int? lightColor,
bool? showBadge,
String? soundPath,
int? soundUsage,
int? soundContentType,
int? soundFlag,
bool? vibration,
List<int>? vibrationPatterns,
}) async {
if (!Platform.isAndroid) {
return {
'code': kAliyunPushOnlyAndroid,
'errorMsg': 'Only support Android',
};
}
Map<dynamic, dynamic> result =
await methodChannel.invokeMethod('createChannel', {
'id': id,
'name': name,
'importance': importance,
'desc': description,
'groupId': groupId,
'allowBubbles': allowBubbles,
'light': light,
'lightColor': lightColor,
'showBadge': showBadge,
'soundPath': soundPath,
'soundUsage': soundUsage,
'soundContentType': soundContentType,
'soundFlag': soundFlag,
'vibration': vibration,
'vibrationPatterns': vibrationPatterns,
});
return result;
}