createDefaultChannels method

Future<void> createDefaultChannels()

Creates all default notification channels.

Should be called during app initialization on Android devices. On iOS and web, this is a no-op.

Implementation

Future<void> createDefaultChannels() async {
  if (kIsWeb || !Platform.isAndroid) {
    logd('Skipping notification channel creation (not Android)');
    return;
  }

  try {
    await Future.wait([
      createChannel(_highPriorityChannel),
      createChannel(_defaultChannel),
      createChannel(_lowPriorityChannel),
      createChannel(_silentChannel),
    ]);
    logi('Created ${_defaultChannels.length} notification channels');
  } catch (e, stack) {
    loge(stack, 'Failed to create notification channels: $e');
  }
}