checkPendingSettingsIntentForTesting method

  1. @visibleForTesting
Future<void> checkPendingSettingsIntentForTesting()

Exposes the pending intent check logic from initialize for direct testing. Unlike the production path in initialize, this does NOT use addPostFrameCallback — the deep link handler is invoked directly. This is appropriate for unit tests where the widget tree is not relevant.

Implementation

@visibleForTesting
Future<void> checkPendingSettingsIntentForTesting() async {
  if (_settingsChannel == null) return;
  try {
    final pending = await _settingsChannel!
        .invokeMethod<Map<dynamic, dynamic>?>('getPendingSettingsIntent');
    if (pending != null) {
      final channelId = pending['channelId'] as String?;
      await _handleSettingsDeepLink(channelId);
    }
  } on MissingPluginException {
    logd('No native handler for getPendingSettingsIntent — cold launch '
        'deep links will not be detected');
  }
}