createNotificationChannel method
Future<bool>
createNotificationChannel({
- required String channelId,
- required String channelName,
- String? channelDescription,
- int? importance,
- bool? enableLights,
- bool? enableVibration,
- String? sound,
override
设置通知渠道
Implementation
@override
Future<bool> createNotificationChannel({
required String channelId,
required String channelName,
String? channelDescription,
int? importance,
bool? enableLights,
bool? enableVibration,
String? sound,
}) async {
try {
final result = await methodChannel.invokeMethod<bool>('createNotificationChannel', {
'channelId': channelId,
'channelName': channelName,
'channelDescription': channelDescription,
'importance': importance,
'enableLights': enableLights,
'enableVibration': enableVibration,
'sound': sound,
});
return result ?? false;
} catch (e) {
debugPrint('HuaweiPush createNotificationChannel error: $e');
return false;
}
}