用Try Catch包装您的fetch()和ActivateFetched()API调用
try { // Using default duration to force fetching from remote server. await remoteConfig.fetch(expiration: const Duration(seconds: 0)); await remoteConfig.activateFetched(); } on FetchThrottledException catch (exception) { // Fetch throttled. print(exception); } catch (exception) { print( 'Unable to fetch remote config. Cached or default values will be ' 'used'); }
在此处查看官方示例:https
:
//github.com/flutter/plugins/blob/master/packages/firebase_remote_config/example/lib/main.dart
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)