Flutter Web应用程序中是否可以使用Firebase RemoteConfig?

3

我正在尝试在我的Flutter Web应用程序中使用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)
2个回答

2

更新: 新版本已发布,支持Web上的远程配置。

目前,Flutter Web不支持远程配置。 链接

See


2

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


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接