firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.62k stars 3.95k forks source link

🐛 [FirebaseFirestore][I-FST000001] WatchStream (13fff29b8) Stream error: 'Unavailable: Network connectivity changed' #9571

Closed Flucadetena closed 1 year ago

Flucadetena commented 1 year ago

Bug report

Describe the bug

The error is stated by [Firebase/Analytics] and says :
9.4.0 - [FirebaseAnalytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
    apiKey = 'API-KEY';
    lang = en;
    mode = signIn;
    oobCode = "eRa_RriiBEtWXLOkv9ZydSAt5_VKljel-UM5g1g0SUoAAAGDVNEObQ";
}

Steps to reproduce

Steps to reproduce the behavior:

  1. Create a Flutter project
  2. add firebase analytics and firebase dynamic links and auth
  3. create a new user using email/link authentication
  4. when trying to login on IOS get this error. On Android works fine

Expected behavior

For the link to work


Additional context

I already faced this issue long ago on another firebase release and only solve it by downgrading the package version, but in this case I need to stay on this update.


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [✓] Flutter (Channel stable, 3.3.2, on macOS 12.5.1 21G83 darwin-arm, locale es-ES) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.2) [✓] VS Code (version 1.71.2) [✓] Connected device (2 available) [✓] HTTP Host Availability ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` Dart SDK 2.18.1 Flutter SDK 3.3.2 movn 1.3.1+43 dependencies: - animated_background 2.0.0 [flutter meta] - animated_stack 0.2.0 [flutter] - app_review 2.1.2+1 [http package_info_plus url_launcher flutter] - audioplayers 0.20.1 [uuid path_provider http flutter flutter_web_plugins] - auto_size_text 3.0.0 [flutter] - calendar_timeline 1.0.5 [flutter intl scrollable_positioned_list] - carousel_slider 4.1.1 [flutter] - cloud_firestore 3.4.8 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta] - cloud_functions 3.3.6 [cloud_functions_platform_interface cloud_functions_web firebase_core firebase_core_platform_interface flutter] - collection 1.16.0 - country_code_picker 2.0.2 [flutter modal_bottom_sheet collection universal_platform] - cupertino_icons 1.0.5 - custom_refresh_indicator 1.2.1 [flutter] - expandable 5.0.1 [flutter] - firebase_analytics 9.3.5 [firebase_analytics_platform_interface firebase_analytics_web firebase_core firebase_core_platform_interface flutter] - firebase_app_check 0.0.7 [firebase_app_check_platform_interface firebase_app_check_web firebase_core firebase_core_platform_interface flutter] - firebase_crashlytics 2.8.9 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace] - firebase_messaging 13.0.0 [firebase_core firebase_core_platform_interface firebase_messaging_platform_interface firebase_messaging_web flutter meta] - firebase_performance 0.8.2+4 [firebase_core firebase_core_platform_interface firebase_performance_platform_interface firebase_performance_web flutter] - firebase_storage 10.3.7 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter] - fl_chart 0.55.1 [flutter equatable] - flag 6.0.0 [flutter flutter_svg enum_to_string] - flip 2.0.0 [flutter] - floating_bubbles 2.1.3 [simple_animations audioplayers path_provider flutter] - flutter 0.0.0 [characters collection material_color_utilities meta vector_math sky_engine] - flutter_cache_manager 3.3.0 [clock collection file flutter http path path_provider pedantic rxdart sqflite uuid] - flutter_countdown_timer 4.1.0 [flutter] - flutter_cube 0.1.7 [flutter vector_math http path] - flutter_html 3.0.0-alpha.5 [html csslib collection numerus flutter] - flutter_inappwebview 5.4.3+7 [flutter] - flutter_localizations 0.0.0 [flutter intl characters clock collection material_color_utilities meta path vector_math] - flutter_speed_dial 6.0.0 [flutter] - flutter_staggered_grid_view 0.6.2 [flutter] - flutter_stripe 4.0.0 [flutter stripe_android stripe_ios stripe_platform_interface] - flutter_vibrate 1.3.0 [flutter] - geoflutterfire 3.0.3 [flutter cloud_firestore rxdart flutter_lints] - get 4.6.5 [flutter] - google_fonts 3.0.1 [flutter http path_provider crypto] - google_maps_flutter 2.1.12 [flutter google_maps_flutter_android google_maps_flutter_ios google_maps_flutter_platform_interface] - google_sign_in 5.4.1 [flutter google_sign_in_android google_sign_in_ios google_sign_in_platform_interface google_sign_in_web] - health 4.0.0 [flutter intl device_info_plus] - health_kit_reporter 2.0.4 [flutter] - http 0.13.5 [async http_parser meta path] - icons_launcher 2.0.4 [args image path universal_io yaml] - image_cropper 3.0.0 [flutter image_cropper_platform_interface image_cropper_for_web] - image_picker 0.8.5+3 [flutter image_picker_android image_picker_for_web image_picker_ios image_picker_platform_interface] - intl 0.17.0 [clock path] - location 4.4.0 [flutter location_platform_interface location_web] - lottie 1.4.2 [archive flutter path vector_math] - native_pdf_view 6.0.0+1 [flutter pdfx] - package_info_plus 1.4.2 [flutter package_info_plus_platform_interface package_info_plus_linux package_info_plus_macos package_info_plus_windows package_info_plus_web] - path_provider 2.0.11 [flutter path_provider_android path_provider_ios path_provider_linux path_provider_macos path_provider_platform_interface path_provider_windows] - pay 1.0.10 [flutter flutter_localizations pay_android pay_ios pay_platform_interface meta] - percent_indicator 4.2.2 [flutter] - permission_handler 10.0.0 [flutter meta permission_handler_android permission_handler_apple permission_handler_windows permission_handler_platform_interface] - qr_code_scanner 1.0.1 [js flutter flutter_web_plugins] - reorderables 0.5.0 [flutter] - rxdart 0.27.5 - scrollable_positioned_list 0.3.2 [flutter collection] - shared_preferences 2.0.15 [flutter shared_preferences_android shared_preferences_ios shared_preferences_linux shared_preferences_macos shared_preferences_platform_interface shared_preferences_web shared_preferences_windows] - sign_in_with_apple 4.1.0 [flutter meta sign_in_with_apple_platform_interface sign_in_with_apple_web] - skeleton_animation 0.1.4 [flutter] - sliding_up_panel 2.0.0+1 [flutter] - timeago 3.3.0 [intl] - url_launcher 6.1.5 [flutter url_launcher_android url_launcher_ios url_launcher_linux url_launcher_macos url_launcher_platform_interface url_launcher_web url_launcher_windows] dev dependencies: - flutter_lints 1.0.4 [lints] - flutter_test 0.0.0 [flutter test_api path fake_async clock stack_trace vector_math async boolean_selector characters collection matcher material_color_utilities meta source_span stream_channel string_scanner term_glyph] transitive dependencies: - archive 3.3.1 [crypto path] - args 2.3.1 - async 2.9.0 [collection meta] - boolean_selector 2.1.0 [source_span string_scanner] - characters 1.2.1 - clock 1.1.1 - cloud_firestore_platform_interface 5.7.4 [collection firebase_core flutter meta plugin_platform_interface] - cloud_firestore_web 2.8.7 [cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js] - cloud_functions_platform_interface 5.1.15 [firebase_core flutter meta plugin_platform_interface] - cloud_functions_web 4.3.4 [cloud_functions_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - cross_file 0.3.3+1 [js meta] - crypto 3.0.2 [typed_data] - csslib 0.17.2 [source_span] - device_info_plus 3.2.4 [flutter device_info_plus_platform_interface device_info_plus_macos device_info_plus_linux device_info_plus_web device_info_plus_windows] - device_info_plus_linux 2.1.1 [device_info_plus_platform_interface file flutter meta] - device_info_plus_macos 2.2.3 [device_info_plus_platform_interface flutter] - device_info_plus_platform_interface 2.6.1 [flutter meta plugin_platform_interface] - device_info_plus_web 2.1.0 [device_info_plus_platform_interface flutter_web_plugins flutter] - device_info_plus_windows 2.1.1 [device_info_plus_platform_interface ffi flutter win32] - enum_to_string 2.0.1 - equatable 2.0.5 [collection meta] - extension 0.2.0 - fake_async 1.3.1 [clock collection] - ffi 1.2.1 - file 6.1.4 [meta path] - firebase 9.0.3 [http http_parser js] - firebase_analytics_platform_interface 3.3.4 [firebase_core flutter meta plugin_platform_interface] - firebase_analytics_web 0.4.2+4 [firebase_analytics_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_app_check_platform_interface 0.0.4+15 [firebase_core flutter meta plugin_platform_interface] - firebase_app_check_web 0.0.6+4 [firebase_app_check_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins js] - firebase_auth 3.7.0 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta] - firebase_auth_platform_interface 6.6.0 [collection firebase_core flutter meta plugin_platform_interface] - firebase_auth_web 4.3.0 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser intl js meta] - firebase_core 1.21.1 [firebase_core_platform_interface firebase_core_web flutter meta] - firebase_core_platform_interface 4.5.1 [collection flutter flutter_test meta plugin_platform_interface] - firebase_core_web 1.7.2 [firebase_core_platform_interface flutter flutter_web_plugins js meta] - firebase_crashlytics_platform_interface 3.2.15 [collection firebase_core flutter meta plugin_platform_interface] - firebase_dynamic_links 4.3.7 [firebase_core firebase_core_platform_interface firebase_dynamic_links_platform_interface flutter meta plugin_platform_interface] - firebase_dynamic_links_platform_interface 0.2.3+12 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_platform_interface 4.1.3 [firebase_core flutter meta plugin_platform_interface] - firebase_messaging_web 3.1.3 [firebase_core firebase_core_web firebase_messaging_platform_interface flutter flutter_web_plugins js meta] - firebase_performance_platform_interface 0.1.1+15 [firebase_core flutter plugin_platform_interface] - firebase_performance_web 0.1.1+4 [firebase firebase_core firebase_core_web firebase_performance_platform_interface flutter flutter_web_plugins js] - firebase_storage_platform_interface 4.1.15 [collection firebase_core flutter meta plugin_platform_interface] - firebase_storage_web 3.3.5 [async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta] - flutter_plugin_android_lifecycle 2.0.7 [flutter] - flutter_statusbarcolor_ns 0.4.0 [flutter] - flutter_svg 1.1.4 [flutter meta path_drawing vector_math xml] - flutter_web_plugins 0.0.0 [flutter js characters collection material_color_utilities meta vector_math] - freezed_annotation 2.1.0 [collection json_annotation meta] - google_maps_flutter_android 2.2.0 [flutter flutter_plugin_android_lifecycle google_maps_flutter_platform_interface stream_transform] - google_maps_flutter_ios 2.1.11 [flutter google_maps_flutter_platform_interface stream_transform] - google_maps_flutter_platform_interface 2.2.2 [collection flutter plugin_platform_interface stream_transform] - google_sign_in_android 6.1.0 [flutter google_sign_in_platform_interface] - google_sign_in_ios 5.5.0 [flutter google_sign_in_platform_interface] - google_sign_in_platform_interface 2.3.0 [flutter plugin_platform_interface quiver] - google_sign_in_web 0.10.2 [flutter flutter_web_plugins google_sign_in_platform_interface js] - html 0.15.0 [csslib source_span] - http_parser 4.0.1 [collection source_span string_scanner typed_data] - image 3.2.0 [archive meta xml] - image_cropper_for_web 1.0.2 [flutter flutter_web_plugins image_cropper_platform_interface js] - image_cropper_platform_interface 3.0.2 [flutter plugin_platform_interface http] - image_picker_android 0.8.5+2 [flutter flutter_plugin_android_lifecycle image_picker_platform_interface] - image_picker_for_web 2.1.8 [flutter flutter_web_plugins image_picker_platform_interface] - image_picker_ios 0.8.5+6 [flutter image_picker_platform_interface] - image_picker_platform_interface 2.6.1 [cross_file flutter http plugin_platform_interface] - js 0.6.4 - json_annotation 4.6.0 [meta] - lints 1.0.1 - location_platform_interface 2.3.0 [flutter meta plugin_platform_interface] - location_web 3.1.1 [flutter flutter_web_plugins http_parser js location_platform_interface meta] - matcher 0.12.12 [stack_trace] - material_color_utilities 0.1.5 - meta 1.8.0 - mime 1.0.2 - modal_bottom_sheet 2.1.0 [flutter] - numerus 1.1.1 - package_info_plus_linux 1.0.5 [package_info_plus_platform_interface flutter path] - package_info_plus_macos 1.3.0 [flutter] - package_info_plus_platform_interface 1.0.2 [flutter meta plugin_platform_interface] - package_info_plus_web 1.0.5 [flutter flutter_web_plugins http meta package_info_plus_platform_interface] - package_info_plus_windows 1.0.5 [package_info_plus_platform_interface ffi flutter win32] - path 1.8.2 - path_drawing 1.0.1 [vector_math meta path_parsing flutter] - path_parsing 1.0.1 [vector_math meta] - path_provider_android 2.0.20 [flutter path_provider_platform_interface] - path_provider_ios 2.0.11 [flutter path_provider_platform_interface] - path_provider_linux 2.1.7 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_macos 2.0.6 [flutter path_provider_platform_interface] - path_provider_platform_interface 2.0.4 [flutter platform plugin_platform_interface] - path_provider_windows 2.0.7 [ffi flutter path path_provider_platform_interface win32] - pay_android 1.0.7 [flutter flutter_localizations pay_platform_interface flutter_svg] - pay_ios 1.0.7 [flutter pay_platform_interface] - pay_platform_interface 1.0.2 [flutter yaml] - pdfx 1.0.1+1 [flutter flutter_web_plugins plugin_platform_interface js device_info_plus uuid meta extension synchronized universal_platform photo_view vector_math] - pedantic 1.11.1 - permission_handler_android 10.0.0 [flutter permission_handler_platform_interface] - permission_handler_apple 9.0.4 [flutter permission_handler_platform_interface] - permission_handler_platform_interface 3.7.0 [flutter meta plugin_platform_interface] - permission_handler_windows 0.1.0 [flutter permission_handler_platform_interface] - petitparser 5.0.0 [meta] - photo_view 0.13.0 [flutter] - platform 3.1.0 - plugin_platform_interface 2.1.2 [meta] - process 4.2.4 [file path platform] - quiver 3.1.0 [matcher] - safe_device 1.1.1 [flutter trust_location] - share 2.0.4 [meta mime flutter] - shared_preferences_android 2.0.12 [flutter shared_preferences_platform_interface] - shared_preferences_ios 2.1.1 [flutter shared_preferences_platform_interface] - shared_preferences_linux 2.1.1 [file flutter path path_provider_linux path_provider_platform_interface shared_preferences_platform_interface] - shared_preferences_macos 2.0.4 [flutter shared_preferences_platform_interface] - shared_preferences_platform_interface 2.1.0 [flutter plugin_platform_interface] - shared_preferences_web 2.0.4 [flutter flutter_web_plugins shared_preferences_platform_interface] - shared_preferences_windows 2.1.1 [file flutter path path_provider_platform_interface path_provider_windows shared_preferences_platform_interface] - sign_in_with_apple_platform_interface 1.0.0 [flutter plugin_platform_interface meta] - sign_in_with_apple_web 1.0.1 [flutter flutter_web_plugins sign_in_with_apple_platform_interface js] - simple_animations 4.2.0 [flutter collection] - sky_engine 0.0.99 - source_span 1.9.0 [collection path term_glyph] - sqflite 2.0.3+1 [flutter sqflite_common path] - sqflite_common 2.2.1+1 [synchronized path meta] - stack_trace 1.10.0 [path] - stream_channel 2.1.0 [async] - stream_transform 2.0.0 - string_scanner 1.1.1 [source_span] - stripe_android 4.0.0 [flutter] - stripe_ios 4.0.0 [flutter] - stripe_platform_interface 4.0.0 [flutter freezed_annotation json_annotation meta plugin_platform_interface] - synchronized 3.0.0+2 - term_glyph 1.2.1 - test_api 0.4.12 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - transparent_image 2.0.0 - trust_location 2.0.13 [flutter] - typed_data 1.3.1 [collection] - universal_io 2.0.4 [collection crypto meta typed_data] - universal_platform 1.0.0+1 - url_launcher_android 6.0.17 [flutter url_launcher_platform_interface] - url_launcher_ios 6.0.17 [flutter url_launcher_platform_interface] - url_launcher_linux 3.0.1 [flutter url_launcher_platform_interface] - url_launcher_macos 3.0.1 [flutter url_launcher_platform_interface] - url_launcher_platform_interface 2.1.0 [flutter plugin_platform_interface] - url_launcher_web 2.0.13 [flutter flutter_web_plugins url_launcher_platform_interface] - url_launcher_windows 3.0.1 [flutter url_launcher_platform_interface] - uuid 3.0.6 [crypto] - vector_math 2.1.2 - win32 2.6.1 [ffi] - xdg_directories 0.2.0+2 [meta path process] - xml 6.1.0 [collection meta petitparser] - yaml 3.1.1 [collection source_span string_scanner] ```

darshankawar commented 1 year ago

@Flucadetena Thanks for the report. I am unable to replicate this using steps you provided and using below code sample:

import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_dynamic_links/firebase_dynamic_links.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:triage/firebase_options.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:firebase_auth/firebase_auth.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
  // }
  runApp(MaterialApp(
    title: 'Dynamic Links Example',
    routes: <String, WidgetBuilder>{
      '/': (BuildContext context) => _MainScreen(),
      '/helloworld': (BuildContext context) => _DynamicLinkScreen(),
    },
  ));
}

class _MainScreen extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _MainScreenState();
}

class _MainScreenState extends State<_MainScreen> {
  String? _linkMessage;
  bool _isCreatingLink = false;
  String _testString =
      'To test: long press link and then copy and click from a non-browser '
      "app. Make sure this isn't being tested on iOS simulator and iOS xcode "
      'is properly setup. Look at firebase_dynamic_links/README.md for more '
      'details.';

  @override
  void initState() {
    super.initState();
    initDynamicLinks();
  }

  FirebaseDynamicLinks dynamicLinks = FirebaseDynamicLinks.instance;

  Future<void> initDynamicLinks() async {
    FirebaseDynamicLinks.instance.onLink.listen((event) {
      print("Event link : ${event.link.path}");
    });
    if (FirebaseAuth.instance.currentUser == null) {
      await FirebaseAuth.instance.signInWithEmailAndPassword(email: "your test email", password: "password");
    }
    FirebaseAuth.instance.currentUser!.sendEmailVerification();
  }

//  }

  Future<void> _createDynamicLink(bool short) async {
    setState(() {
      _isCreatingLink = true;
    });

    final DynamicLinkParameters parameters = DynamicLinkParameters(
      uriPrefix: 'https://testtriage.page.link',
      link: Uri.parse('https://testtriage.page.link/helloworld'),
      androidParameters: AndroidParameters(
        packageName: 'com.nevercode.triage',
        minimumVersion: 0,
      ),
      // dynamicLinkParametersOptions: DynamicLinkParametersOptions(
      //   shortDynamicLinkPathLength: ShortDynamicLinkPathLength.short,
      // ),
      iosParameters: IOSParameters(
        appStoreId: "1550275619",
        bundleId: 'com.nevercode.triage',
        minimumVersion: '0',
      ),
    );

    Uri url;
    if (short) {
      final ShortDynamicLink shortLink =
          await dynamicLinks.buildShortLink(parameters);
      url = shortLink.shortUrl;
    } else {
      url = await dynamicLinks.buildLink(parameters);
    }

    setState(() {
      _linkMessage = url.toString();
      _isCreatingLink = false;
    });
  }

  final longLink =
      'https://testtriage.page.link/?link=https://testtriage.page.link/helloworld&apn=com.nevercode.triage&isi=1550275619&ibi=com.nevercode.triage&imv=0&cid=4851616250011841714&_icp=1';

  @override
  Widget build(BuildContext context) {
    return Material(
      child: Scaffold(
        appBar: AppBar(
          title: const Text('Dynamic Links Example'),
        ),
        body: Builder(builder: (BuildContext context) {
          return Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
                ButtonBar(
                  alignment: MainAxisAlignment.center,
                  children: <Widget>[
                    ElevatedButton(
                      onPressed: !_isCreatingLink
                          ? () => _createDynamicLink(false)
                          : null,
                      child: const Text('Get Long Link'),
                    ),
                    ElevatedButton(
                      onPressed: !_isCreatingLink
                          ? () => _createDynamicLink(true)
                          : null,
                      child: const Text('Get Short Link'),
                    ),
                  ],
                ),
                InkWell(
                  onTap: () async {
                    if (_linkMessage != null) {
                      await launch(_linkMessage!);
                    }
                  },
                  onLongPress: () {
                    Clipboard.setData(ClipboardData(text: _linkMessage));
                    ScaffoldMessenger.of(context).showSnackBar(
                      const SnackBar(content: Text('Copied Link!')),
                    );
                  },
                  child: Text(
                    _linkMessage ?? '',
                    style: const TextStyle(color: Colors.blue),
                  ),
                ),
                Text(_linkMessage == null ? '' : _testString)
              ],
            ),
          );
        }),
      ),
    );
  }
}

class _DynamicLinkScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Material(
      child: Scaffold(
        appBar: AppBar(
          title: const Text('Hello World DeepLink'),
        ),
        body: const Center(
          child: Text('Hello, World!'),
        ),
      ),
    );
  }
}

Running above code on iOS simulator and verifying the email received, I tapped on the dynamic link created which prints:

flutter: Event link : /helloworld and took me to the specific screen on the app.

Can you try the same and see if you are able to get same error using above code ?

Also, for your reference, please check this similar issue and this from native iOS sdk github for further reference.

google-oss-bot commented 1 year ago

Hey @Flucadetena. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Flucadetena commented 1 year ago

Hi, sorry for the delay.

Have you added "firebase_analytics" to the pubspec? I think the main issue is a conflict between the two. I've updated everything today and have the same issue with 9.5.0

9.5.0 - [FirebaseAnalytics][I-ACS800014] Cannot get flag for unregistered flag. SDK name, flag name: app_measurement, session_stitching_token_feature_enabled
[Snapshotting] Snapshotting a view (0x14606e000, UIKeyboardImpl) that is not in a visible window requires afterScreenUpdates:YES.
9.5.0 - [FirebaseFirestore][I-FST000001] WatchStream (13fff29b8) Stream error: 'Unavailable: Network connectivity changed'
9.5.0 - [FirebaseAnalytics][I-ACS023001] Deep Link does not contain valid required params. URL params: {
    apiKey = 'API-KEY';
    lang = en;
    mode = signIn;
    oobCode = "D3mXYi43ruA2ny2du8g03yFRg1gf4LS3gJCny68wbecAAAGDiEJ-OA";
}

Maybe it has something to do with the Stream Error I get from firestore. But every time I had this issue the analytics log would popup.

BTW: I'm running on a physical phone, not the emulator. As I've seen some say that is an error in the emulator on apple M1.

Flucadetena commented 1 year ago

Ok, un update, the error has nothing to do with analytics. After a while I was able to remove all analytics and the error still happens.

It looks like the problem is firestore losing the connection.

9.5.0 - [FirebaseFirestore][I-FST000001] WatchStream (108f9b468) Stream error: 'Unavailable: Network connectivity changed'

This error was mentions here: (#8503)[https://github.com/firebase/firebase-ios-sdk/issues/8503] and move to here: (#27092)[https://github.com/grpc/grpc/issues/27092]

But there is no apparent update. What can i do?

Thanks for the help.

Flucadetena commented 1 year ago

I've downgraded to 9.2.0 and still have the problem with some additional logs:

[Snapshotting] Snapshotting a view (0x10b075000, UIKeyboardImpl) that is not in a visible window requires afterScreenUpdates:YES.
dnssd_clientstub read_all(21) DEFUNCT
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
dnssd_clientstub read_all(23) DEFUNCT
[VERBOSE-2:FlutterObservatoryPublisher.mm(143)] Could not register as server for FlutterObservatoryPublisher. Check your network settings and relaunch the application.
9.2.0 - [FirebaseFirestore][I-FST000001] WatchStream (1040d3358) Stream error: 'Unavailable: Network connectivity changed'
dnssd_clientstub write_all(31) DEFUNCT
dnssd_clientstub deliver_request ERROR: write_all(31, 81 bytes) failed
dnssd_clientstub write_all(31) DEFUNCT

I've tried with wifi and network connection. The internet is very good so that should not be the problem.

darshankawar commented 1 year ago

Thanks for digging in and sharing these details. As the main error is now Stream error: 'Unavailable: Network connectivity changed', maybe can you try to add a delay and see if it help ?

This error was mentions here: (#8503)[https://github.com/[firebase/firebase-ios-sdk/issues/8503](https://github.com/firebase/firebase-ios-sdk/issues/8503)] and move to here: (#27092)[https://github.com/[grpc/grpc/issues/27092](https://github.com/grpc/grpc/issues/27092)]

For this, please see below links from native sdk and check if they help:

https://github.com/firebase/firebase-ios-sdk/issues/1060#issuecomment-380319526 https://github.com/firebase/firebase-ios-sdk/issues/1060#issuecomment-380337456

What can i do?

A better option would be to reach out to Firebase support and see if they can help you further.

Flucadetena commented 1 year ago

Ok I found the problem. Apparently there is some type of conflict on IOS when you have multiple domains in your deeplinks.

Firebase takes the first one to create the auth link, and although it uses the link stated in the params when creating the deeplink to redirect to the app, it apparently doesn't recognize the link and shows that strange error. So actually the analytics error was right when stating that the link was didn't contain valid params.

I had to delete all the url prefix in the dynamic link section to use the one I wanted and make it work.

I guess this is something that needs to be implemented to be able to choose which prefix is used by firebase to create de auth link.

I will file a bug/feature request with the firebase support team. Thanks for the help. If you need me to extend on the issue let me know.

darshankawar commented 1 year ago

Thanks for sharing this update and finding root-cause. Would be good to know the issue you would open for our reference here.