【问题标题】:Is it possible to use Firebase RemoteConfig in Flutter Web App?是否可以在 Flutter Web App 中使用 Firebase RemoteConfig?
【发布时间】:2021-10-04 13:20:04
【问题描述】:

我试图在我的 Flutter Web App 中使用 Firebase RemoteConfig,但是当我调用方法“fetchAndActivate”时,出现了一个奇怪的错误:

WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
RemoteConfig.instance.fetchAndActivate();

错误:

Error: Expected a value of type 'int', but got one of type 'Null'
    at Object.throw_ [as throw] (http://localhost:53640/dart_sdk.js:5032:11)
    at Object.castError (http://localhost:53640/dart_sdk.js:5005:15)
    at Object.cast [as as] (http://localhost:53640/dart_sdk.js:5314:17)
    at Function.as (http://localhost:53640/dart_sdk.js:17870:19)
    at method_channel_firebase_remote_config.MethodChannelFirebaseRemoteConfig.new.setInitialValues (http://localhost:53640/packages/firebase_remote_config_platform_interface/src/method_channel/method_channel_firebase_remote_config.dart.lib.js:288:67)

【问题讨论】:

    标签: firebase flutter dart flutter-web firebase-remote-config


    【解决方案1】:

    目前,Flutter Web 不支持远程配置。 Link.

    【讨论】:

      【解决方案2】:

      文档说它现在支持 (2021) https://firebase.flutter.dev/ 升级到 firebase_remote_config 后我可以在 Web 应用程序中使用它:^1.0.2

      【讨论】:

        猜你喜欢
        • 2021-11-01
        • 2021-12-24
        • 2020-11-21
        • 2016-12-31
        • 2021-03-08
        • 2021-07-13
        • 1970-01-01
        • 2020-10-28
        • 2021-07-25
        相关资源
        最近更新 更多